step 2 : auth dengan encrpty not fixed
This commit is contained in:
BIN
backend/__debug_bin98379579.exe
Normal file
BIN
backend/__debug_bin98379579.exe
Normal file
Binary file not shown.
@@ -1,27 +1,15 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
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
|
||||
-----END RSA PRIVATE KEY-----
|
||||
|
||||
@@ -16,33 +16,51 @@ require (
|
||||
|
||||
require (
|
||||
github.com/agnivade/levenshtein v1.1.1 // indirect
|
||||
github.com/cilium/ebpf v0.11.0 // indirect
|
||||
github.com/cosiner/argv v0.1.0 // indirect
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
|
||||
github.com/derekparker/trie v0.0.0-20230829180723-39f4de51ef7d // indirect
|
||||
github.com/go-delve/delve v1.22.0 // indirect
|
||||
github.com/go-delve/gore v0.11.6 // indirect
|
||||
github.com/go-delve/liner v1.2.3-0.20220127212407-d32d89dd2a5d // indirect
|
||||
github.com/google/go-dap v0.11.0 // indirect
|
||||
github.com/google/uuid v1.5.0 // indirect
|
||||
github.com/gorilla/websocket v1.5.1 // indirect
|
||||
github.com/hashicorp/golang-lru v1.0.2 // indirect
|
||||
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
|
||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
||||
github.com/magiconair/properties v1.8.7 // indirect
|
||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||
github.com/mattn/go-runewidth v0.0.13 // indirect
|
||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
|
||||
github.com/rivo/uniseg v0.2.0 // indirect
|
||||
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
||||
github.com/sagikazarmark/locafero v0.4.0 // indirect
|
||||
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
|
||||
github.com/sirupsen/logrus v1.9.3 // indirect
|
||||
github.com/sosodev/duration v1.2.0 // indirect
|
||||
github.com/sourcegraph/conc v0.3.0 // indirect
|
||||
github.com/spf13/afero v1.11.0 // indirect
|
||||
github.com/spf13/cast v1.6.0 // indirect
|
||||
github.com/spf13/cobra v1.7.0 // indirect
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
github.com/subosito/gotenv v1.6.0 // indirect
|
||||
github.com/urfave/cli/v2 v2.25.5 // indirect
|
||||
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
|
||||
go.starlark.net v0.0.0-20231101134539-556fd59b42f6 // indirect
|
||||
go.uber.org/atomic v1.9.0 // indirect
|
||||
go.uber.org/multierr v1.9.0 // indirect
|
||||
golang.org/x/arch v0.6.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
|
||||
golang.org/x/mod v0.12.0 // indirect
|
||||
golang.org/x/mod v0.14.0 // indirect
|
||||
golang.org/x/net v0.20.0 // indirect
|
||||
golang.org/x/sys v0.16.0 // indirect
|
||||
golang.org/x/text v0.14.0 // indirect
|
||||
golang.org/x/tools v0.13.0 // indirect
|
||||
golang.org/x/tools v0.14.0 // indirect
|
||||
gopkg.in/ini.v1 v1.67.0 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
)
|
||||
|
||||
@@ -10,12 +10,18 @@ github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x0
|
||||
github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA=
|
||||
github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig+0+Ap1h4unLjW6YQJpKZVmUzxsD4E/Q=
|
||||
github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE=
|
||||
github.com/cilium/ebpf v0.11.0 h1:V8gS/bTCCjX9uUnkUFUpPsksM8n1lXBAvHcpiFk1X2Y=
|
||||
github.com/cilium/ebpf v0.11.0/go.mod h1:WE7CZAnqOL2RouJ4f1uyNhqr2P4CCvXFIqdRDUgWsVs=
|
||||
github.com/cosiner/argv v0.1.0 h1:BVDiEL32lwHukgJKP87btEPenzrrHUjajs/8yzaqcXg=
|
||||
github.com/cosiner/argv v0.1.0/go.mod h1:EusR6TucWKX+zFgtdUsKT2Cvg45K5rtpCcWz4hK06d8=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/derekparker/trie v0.0.0-20230829180723-39f4de51ef7d h1:hUWoLdw5kvo2xCsqlsIBMvWUc1QCSsCYD2J2+Fg6YoU=
|
||||
github.com/derekparker/trie v0.0.0-20230829180723-39f4de51ef7d/go.mod h1:C7Es+DLenIpPc9J6IYw4jrK0h7S9bKj4DNl8+KxGEXU=
|
||||
github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=
|
||||
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
|
||||
github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48 h1:fRzb/w+pyskVMQ+UbP35JkH8yB7MYb4q/qhBarqZE6g=
|
||||
@@ -26,24 +32,44 @@ github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nos
|
||||
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
|
||||
github.com/go-chi/chi v1.5.5 h1:vOB/HbEMt9QqBqErz07QehcOKHaWFtuj87tTDVz2qXE=
|
||||
github.com/go-chi/chi v1.5.5/go.mod h1:C9JqLr3tIYjDOZpzn+BCuxY8z8vmca43EeMgyZt7irw=
|
||||
github.com/go-delve/delve v1.22.0 h1:c7GOFs49/jMGHdp10KphKkGqNmLjOp7fcwz1MQwcMlw=
|
||||
github.com/go-delve/delve v1.22.0/go.mod h1:cSvtTzN0Ei8NsPH7TbxeQSLBmdsreeAD5p1UNhrII7w=
|
||||
github.com/go-delve/gore v0.11.6 h1:MyP7xTNQO+dDiLBKxI/DKgkn74cMBjHZZxS8grtJ6G8=
|
||||
github.com/go-delve/gore v0.11.6/go.mod h1:6RBVnEUxVGkztpRY0UDUnEzS4GqETQjWrw8rhegmN4I=
|
||||
github.com/go-delve/liner v1.2.3-0.20220127212407-d32d89dd2a5d h1:pxjSLshkZJGLVm0wv20f/H0oTWiq/egkoJQ2ja6LEvo=
|
||||
github.com/go-delve/liner v1.2.3-0.20220127212407-d32d89dd2a5d/go.mod h1:biJCRbqp51wS+I92HMqn5H8/A0PAhxn2vyOT+JqhiGI=
|
||||
github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI=
|
||||
github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
|
||||
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
||||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/go-dap v0.11.0 h1:SpAZJL41rOOvd85PuLCCLE1dteTQOyKNnn0H3DBHywo=
|
||||
github.com/google/go-dap v0.11.0/go.mod h1:HAeyoSd2WIfTfg+0GRXcFrb+RnojAtGNh+k+XTIxJDE=
|
||||
github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU=
|
||||
github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
|
||||
github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
|
||||
github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c=
|
||||
github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
|
||||
github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k=
|
||||
github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
|
||||
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
|
||||
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
||||
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
|
||||
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
|
||||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
|
||||
github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
|
||||
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
|
||||
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
|
||||
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
|
||||
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
||||
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||
github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
|
||||
github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU=
|
||||
github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
|
||||
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
|
||||
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
|
||||
github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4=
|
||||
@@ -51,6 +77,8 @@ github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdU
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
|
||||
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
||||
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
|
||||
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
|
||||
github.com/rs/cors v1.10.1 h1:L0uuZVXIKlI1SShY2nhFfo44TYvDPQ1w4oFkUJNfhyo=
|
||||
@@ -63,6 +91,8 @@ github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6g
|
||||
github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ=
|
||||
github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8=
|
||||
github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I=
|
||||
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
|
||||
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
|
||||
github.com/sosodev/duration v1.2.0 h1:pqK/FLSjsAADWY74SyWDCjOcd5l7H8GSnnOGEB9A1Us=
|
||||
github.com/sosodev/duration v1.2.0/go.mod h1:RQIBBX0+fMLc/D9+Jb/fwvVmo0eZvDDEERAikUR6SDg=
|
||||
github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo=
|
||||
@@ -71,6 +101,8 @@ github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8=
|
||||
github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY=
|
||||
github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0=
|
||||
github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
|
||||
github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=
|
||||
github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0=
|
||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||
github.com/spf13/viper v1.18.2 h1:LUXCnvUvSM6FXAsj6nnfc8Q2tp1dIgUfY9Kc8GsSOiQ=
|
||||
@@ -79,6 +111,7 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
|
||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
|
||||
@@ -91,26 +124,38 @@ github.com/vektah/gqlparser/v2 v2.5.10 h1:6zSM4azXC9u4Nxy5YmdmGu4uKamfwsdKTwp5zs
|
||||
github.com/vektah/gqlparser/v2 v2.5.10/go.mod h1:1rCcfwB2ekJofmluGWXMSEnPMZgbxzwj6FaZ/4OT8Cc=
|
||||
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU=
|
||||
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8=
|
||||
go.starlark.net v0.0.0-20231101134539-556fd59b42f6 h1:+eC0F/k4aBLC4szgOcjd7bDTEnpxADJyWJE0yowgM3E=
|
||||
go.starlark.net v0.0.0-20231101134539-556fd59b42f6/go.mod h1:LcLNIzVOMp4oV+uusnpk+VU+SzXaJakUuBjoCSWH5dM=
|
||||
go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE=
|
||||
go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
|
||||
go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI=
|
||||
go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ=
|
||||
golang.org/x/arch v0.6.0 h1:S0JTfE48HbRj80+4tbvZDYsJ3tGv6BUU3XxyZ7CirAc=
|
||||
golang.org/x/arch v0.6.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys=
|
||||
golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc=
|
||||
golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg=
|
||||
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g=
|
||||
golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k=
|
||||
golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc=
|
||||
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=
|
||||
golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
||||
golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo=
|
||||
golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY=
|
||||
golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE=
|
||||
golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sys v0.0.0-20211117180635-dee7805ff2e1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
|
||||
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
|
||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ=
|
||||
golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
|
||||
golang.org/x/tools v0.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc=
|
||||
golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
|
||||
@@ -48,8 +48,7 @@ type DirectiveRoot struct {
|
||||
type ComplexityRoot struct {
|
||||
Mutation struct {
|
||||
CreateTodo func(childComplexity int, input model.NewTodo) int
|
||||
GenerateToken func(childComplexity int, email string, idGoogleSignIn string) int
|
||||
LoginAttendance func(childComplexity int, email string, idGoogleSignIn string) int
|
||||
LoginAttendance func(childComplexity int, email string, idGoogleSignIn string, publickey string) int
|
||||
}
|
||||
|
||||
Query struct {
|
||||
@@ -94,8 +93,7 @@ type ComplexityRoot struct {
|
||||
|
||||
type MutationResolver interface {
|
||||
CreateTodo(ctx context.Context, input model.NewTodo) (*model.Todo, error)
|
||||
GenerateToken(ctx context.Context, email string, idGoogleSignIn string) (*model.TokenResponse, error)
|
||||
LoginAttendance(ctx context.Context, email string, idGoogleSignIn string) (*model.Staff, error)
|
||||
LoginAttendance(ctx context.Context, email string, idGoogleSignIn string, publickey string) (*model.Staff, error)
|
||||
}
|
||||
type QueryResolver interface {
|
||||
Todos(ctx context.Context) ([]*model.Todo, error)
|
||||
@@ -135,18 +133,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in
|
||||
|
||||
return e.complexity.Mutation.CreateTodo(childComplexity, args["input"].(model.NewTodo)), true
|
||||
|
||||
case "Mutation.generateToken":
|
||||
if e.complexity.Mutation.GenerateToken == nil {
|
||||
break
|
||||
}
|
||||
|
||||
args, err := ec.field_Mutation_generateToken_args(context.TODO(), rawArgs)
|
||||
if err != nil {
|
||||
return 0, false
|
||||
}
|
||||
|
||||
return e.complexity.Mutation.GenerateToken(childComplexity, args["email"].(string), args["id_google_sign_in"].(string)), true
|
||||
|
||||
case "Mutation.loginAttendance":
|
||||
if e.complexity.Mutation.LoginAttendance == nil {
|
||||
break
|
||||
@@ -157,7 +143,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in
|
||||
return 0, false
|
||||
}
|
||||
|
||||
return e.complexity.Mutation.LoginAttendance(childComplexity, args["email"].(string), args["id_google_sign_in"].(string)), true
|
||||
return e.complexity.Mutation.LoginAttendance(childComplexity, args["email"].(string), args["id_google_sign_in"].(string), args["publickey"].(string)), true
|
||||
|
||||
case "Query.searchStaffByEmail":
|
||||
if e.complexity.Query.SearchStaffByEmail == nil {
|
||||
@@ -508,8 +494,7 @@ extend type Query {
|
||||
|
||||
# mutation untuk perubahan data
|
||||
extend type Mutation {
|
||||
generateToken(email: String!, id_google_sign_in:String!): TokenResponse!
|
||||
loginAttendance(email:String!, id_google_sign_in:String!) : Staff!
|
||||
loginAttendance(email:String!, id_google_sign_in:String!, publickey:String!) : Staff!
|
||||
}`, BuiltIn: false},
|
||||
}
|
||||
var parsedSchema = gqlparser.MustLoadSchema(sources...)
|
||||
@@ -533,30 +518,6 @@ func (ec *executionContext) field_Mutation_createTodo_args(ctx context.Context,
|
||||
return args, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) field_Mutation_generateToken_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
||||
var err error
|
||||
args := map[string]interface{}{}
|
||||
var arg0 string
|
||||
if tmp, ok := rawArgs["email"]; ok {
|
||||
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("email"))
|
||||
arg0, err = ec.unmarshalNString2string(ctx, tmp)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
args["email"] = arg0
|
||||
var arg1 string
|
||||
if tmp, ok := rawArgs["id_google_sign_in"]; ok {
|
||||
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id_google_sign_in"))
|
||||
arg1, err = ec.unmarshalNString2string(ctx, tmp)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
args["id_google_sign_in"] = arg1
|
||||
return args, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) field_Mutation_loginAttendance_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
||||
var err error
|
||||
args := map[string]interface{}{}
|
||||
@@ -578,6 +539,15 @@ func (ec *executionContext) field_Mutation_loginAttendance_args(ctx context.Cont
|
||||
}
|
||||
}
|
||||
args["id_google_sign_in"] = arg1
|
||||
var arg2 string
|
||||
if tmp, ok := rawArgs["publickey"]; ok {
|
||||
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("publickey"))
|
||||
arg2, err = ec.unmarshalNString2string(ctx, tmp)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
args["publickey"] = arg2
|
||||
return args, nil
|
||||
}
|
||||
|
||||
@@ -762,67 +732,6 @@ func (ec *executionContext) fieldContext_Mutation_createTodo(ctx context.Context
|
||||
return fc, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) _Mutation_generateToken(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
||||
fc, err := ec.fieldContext_Mutation_generateToken(ctx, field)
|
||||
if err != nil {
|
||||
return graphql.Null
|
||||
}
|
||||
ctx = graphql.WithFieldContext(ctx, fc)
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
ec.Error(ctx, ec.Recover(ctx, r))
|
||||
ret = graphql.Null
|
||||
}
|
||||
}()
|
||||
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
||||
ctx = rctx // use context from middleware stack in children
|
||||
return ec.resolvers.Mutation().GenerateToken(rctx, fc.Args["email"].(string), fc.Args["id_google_sign_in"].(string))
|
||||
})
|
||||
if err != nil {
|
||||
ec.Error(ctx, err)
|
||||
return graphql.Null
|
||||
}
|
||||
if resTmp == nil {
|
||||
if !graphql.HasFieldError(ctx, fc) {
|
||||
ec.Errorf(ctx, "must not be null")
|
||||
}
|
||||
return graphql.Null
|
||||
}
|
||||
res := resTmp.(*model.TokenResponse)
|
||||
fc.Result = res
|
||||
return ec.marshalNTokenResponse2ᚖcomᚗsismedikaᚗcomᚗabsensiᚋgraphᚋmodelᚐTokenResponse(ctx, field.Selections, res)
|
||||
}
|
||||
|
||||
func (ec *executionContext) fieldContext_Mutation_generateToken(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
||||
fc = &graphql.FieldContext{
|
||||
Object: "Mutation",
|
||||
Field: field,
|
||||
IsMethod: true,
|
||||
IsResolver: true,
|
||||
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
||||
switch field.Name {
|
||||
case "token":
|
||||
return ec.fieldContext_TokenResponse_token(ctx, field)
|
||||
case "message":
|
||||
return ec.fieldContext_TokenResponse_message(ctx, field)
|
||||
}
|
||||
return nil, fmt.Errorf("no field named %q was found under type TokenResponse", field.Name)
|
||||
},
|
||||
}
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
err = ec.Recover(ctx, r)
|
||||
ec.Error(ctx, err)
|
||||
}
|
||||
}()
|
||||
ctx = graphql.WithFieldContext(ctx, fc)
|
||||
if fc.Args, err = ec.field_Mutation_generateToken_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
|
||||
ec.Error(ctx, err)
|
||||
return fc, err
|
||||
}
|
||||
return fc, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) _Mutation_loginAttendance(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
||||
fc, err := ec.fieldContext_Mutation_loginAttendance(ctx, field)
|
||||
if err != nil {
|
||||
@@ -837,7 +746,7 @@ func (ec *executionContext) _Mutation_loginAttendance(ctx context.Context, field
|
||||
}()
|
||||
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
|
||||
ctx = rctx // use context from middleware stack in children
|
||||
return ec.resolvers.Mutation().LoginAttendance(rctx, fc.Args["email"].(string), fc.Args["id_google_sign_in"].(string))
|
||||
return ec.resolvers.Mutation().LoginAttendance(rctx, fc.Args["email"].(string), fc.Args["id_google_sign_in"].(string), fc.Args["publickey"].(string))
|
||||
})
|
||||
if err != nil {
|
||||
ec.Error(ctx, err)
|
||||
@@ -4030,13 +3939,6 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet)
|
||||
if out.Values[i] == graphql.Null {
|
||||
out.Invalids++
|
||||
}
|
||||
case "generateToken":
|
||||
out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) {
|
||||
return ec._Mutation_generateToken(ctx, field)
|
||||
})
|
||||
if out.Values[i] == graphql.Null {
|
||||
out.Invalids++
|
||||
}
|
||||
case "loginAttendance":
|
||||
out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) {
|
||||
return ec._Mutation_loginAttendance(ctx, field)
|
||||
@@ -4906,20 +4808,6 @@ func (ec *executionContext) marshalNTodo2ᚖcomᚗsismedikaᚗcomᚗabsensiᚋgr
|
||||
return ec._Todo(ctx, sel, v)
|
||||
}
|
||||
|
||||
func (ec *executionContext) marshalNTokenResponse2comᚗsismedikaᚗcomᚗabsensiᚋgraphᚋmodelᚐTokenResponse(ctx context.Context, sel ast.SelectionSet, v model.TokenResponse) graphql.Marshaler {
|
||||
return ec._TokenResponse(ctx, sel, &v)
|
||||
}
|
||||
|
||||
func (ec *executionContext) marshalNTokenResponse2ᚖcomᚗsismedikaᚗcomᚗabsensiᚋgraphᚋmodelᚐTokenResponse(ctx context.Context, sel ast.SelectionSet, v *model.TokenResponse) graphql.Marshaler {
|
||||
if v == nil {
|
||||
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
||||
ec.Errorf(ctx, "the requested element is null which the schema does not allow")
|
||||
}
|
||||
return graphql.Null
|
||||
}
|
||||
return ec._TokenResponse(ctx, sel, v)
|
||||
}
|
||||
|
||||
func (ec *executionContext) marshalNUser2ᚖcomᚗsismedikaᚗcomᚗabsensiᚋgraphᚋmodelᚐUser(ctx context.Context, sel ast.SelectionSet, v *model.User) graphql.Marshaler {
|
||||
if v == nil {
|
||||
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
||||
|
||||
@@ -29,6 +29,5 @@ extend type Query {
|
||||
|
||||
# mutation untuk perubahan data
|
||||
extend type Mutation {
|
||||
generateToken(email: String!, id_google_sign_in:String!): TokenResponse!
|
||||
loginAttendance(email:String!, id_google_sign_in:String!) : Staff!
|
||||
loginAttendance(email:String!, id_google_sign_in:String!, publickey:String!) : Staff!
|
||||
}
|
||||
@@ -9,16 +9,15 @@ import (
|
||||
"fmt"
|
||||
|
||||
"com.sismedika.com.absensi/graph/model"
|
||||
staffinternal "com.sismedika.com.absensi/internal/staff"
|
||||
)
|
||||
|
||||
// GenerateToken is the resolver for the generateToken field.
|
||||
func (r *mutationResolver) GenerateToken(ctx context.Context, email string, idGoogleSignIn string) (*model.TokenResponse, error) {
|
||||
panic(fmt.Errorf("not implemented: GenerateToken - generateToken"))
|
||||
}
|
||||
|
||||
// LoginAttendance is the resolver for the loginAttendance field.
|
||||
func (r *mutationResolver) LoginAttendance(ctx context.Context, email string, idGoogleSignIn string) (*model.Staff, error) {
|
||||
panic(fmt.Errorf("not implemented: LoginAttendance - loginAttendance"))
|
||||
func (r *mutationResolver) LoginAttendance(ctx context.Context, email string, idGoogleSignIn string, publickey string) (*model.Staff, error) {
|
||||
// panic(fmt.Errorf("not implemented: LoginAttendance - loginAttendance"))
|
||||
// return r.LoginAttendance(ctx, email, idGoogleSignIn, publickey)
|
||||
var staffinternal staffinternal.Staff
|
||||
return staffinternal.LoginAttendance(email, idGoogleSignIn, publickey)
|
||||
}
|
||||
|
||||
// SearchStaffByEmail is the resolver for the searchStaffByEmail field.
|
||||
@@ -35,3 +34,13 @@ func (r *queryResolver) StaffGetByStaffID(ctx context.Context, staffID string) (
|
||||
func (r *queryResolver) StaffListBySearch(ctx context.Context, search *string, page *int, maxPerPage *int) ([]*model.Staff, error) {
|
||||
panic(fmt.Errorf("not implemented: StaffListBySearch - staffListBySearch"))
|
||||
}
|
||||
|
||||
// !!! WARNING !!!
|
||||
// The code below was going to be deleted when updating resolvers. It has been copied here so you have
|
||||
// one last chance to move it out of harms way if you want. There are two reasons this happens:
|
||||
// - When renaming or deleting a resolver the old code will be put in here. You can safely delete
|
||||
// it when you're done.
|
||||
// - You have helper methods in this file. Move them out to keep these resolver files clean.
|
||||
func (r *mutationResolver) GenerateToken(ctx context.Context, email string, idGoogleSignIn string, publickey string) (*model.TokenResponse, error) {
|
||||
panic(fmt.Errorf("not implemented: GenerateToken - generateToken"))
|
||||
}
|
||||
|
||||
126
backend/internal/staff/staff.go
Normal file
126
backend/internal/staff/staff.go
Normal file
@@ -0,0 +1,126 @@
|
||||
package staff
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
"crypto/rsa"
|
||||
"crypto/x509"
|
||||
"database/sql"
|
||||
"encoding/pem"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
|
||||
"com.sismedika.com.absensi/graph/model"
|
||||
"com.sismedika.com.absensi/pkg/config"
|
||||
db "com.sismedika.com.absensi/pkg/database"
|
||||
)
|
||||
|
||||
// diambil dari graph/model/struct nya Staff
|
||||
type Staff model.Staff
|
||||
|
||||
// staff *Staff = receiver yang memiliki tipe data Staff. liat di graphql
|
||||
// email string, id_google_sign_in string = parameter inputan dari flutter nanti
|
||||
// *model.Staff, error = output yang dihasilkan, jika tidak error return *model.Staff namun jika error maka sebelah kanan nya yaitu
|
||||
// error
|
||||
func (staff *Staff) LoginAttendance(email string, id_google_sign_in string, publickey string) (*model.Staff, error) {
|
||||
|
||||
// inisialisasi
|
||||
var err error
|
||||
var ret model.Staff
|
||||
|
||||
// decode private.pem
|
||||
pemData, err := ioutil.ReadFile(config.Data.Get("privatekey"))
|
||||
if err != nil {
|
||||
log.Printf("read key file: %s", err)
|
||||
return nil, fmt.Errorf(("INTERNAL_SERVER_ERROR"))
|
||||
}
|
||||
|
||||
block, _ := pem.Decode(pemData)
|
||||
if block == nil {
|
||||
log.Printf("bad key data: %s", "not PEM-encoded")
|
||||
return nil, fmt.Errorf(("INTERNAL_SERVER_ERROR"))
|
||||
}
|
||||
|
||||
if got, want := block.Type, "RSA PRIVATE KEY"; got != want {
|
||||
log.Printf("unknown key type %q, want %q", got, want)
|
||||
return nil, fmt.Errorf(("INTERNAL_SERVER_ERROR"))
|
||||
}
|
||||
|
||||
// Decode the RSA private key
|
||||
priv, err := x509.ParsePKCS1PrivateKey(block.Bytes)
|
||||
if err != nil {
|
||||
log.Printf("bad private key: %s", err)
|
||||
return nil, fmt.Errorf(("INTERNAL_SERVER_ERROR"))
|
||||
}
|
||||
|
||||
passEncrypted, err := rsa.EncryptPKCS1v15(rand.Reader, &priv.PublicKey, []byte(publickey))
|
||||
if err != nil {
|
||||
log.Printf("decrypt: %s\n", err)
|
||||
return nil, fmt.Errorf(("DECRYPTION_FAILED"))
|
||||
}
|
||||
|
||||
if passEncrypted != nil {
|
||||
// log.Printf("hasil variable passEncrypted: %s\n", passEncrypted)
|
||||
}
|
||||
|
||||
if priv != nil {
|
||||
// log.Printf("hasil variable priv: %s\n", priv)
|
||||
}
|
||||
|
||||
// data yang akan di tampilkan
|
||||
q := `SELECT
|
||||
M_StaffID,
|
||||
M_StaffNIP,
|
||||
M_StaffName,
|
||||
M_StaffEmail,
|
||||
M_StaffNoHp,
|
||||
M_StaffIsActive,
|
||||
M_StaffIsLogin,
|
||||
M_StaffToken,
|
||||
M_StaffIDGoogleSignIn,
|
||||
M_StaffCreated,
|
||||
M_StaffLastUpdated
|
||||
FROM m_staff
|
||||
WHERE M_StaffIsActive = 'Y'
|
||||
AND M_StaffIDGoogleSignIn = ?
|
||||
AND M_StaffEmail = ?`
|
||||
|
||||
// row merupakan penerima yang akan dimasukkan langsung, menggunakan anotasi :=
|
||||
// id_google_sign_in, email merupakan binding parameter dari tanda tanya "?" di sql
|
||||
row := db.Handle.QueryRow(q, id_google_sign_in, email)
|
||||
db.LogSQL(q)
|
||||
|
||||
// row.Scan untuk mendapatkan field dari sql diatas
|
||||
// NOTE POSISI ROW SCAN HARUS SAMA PERSIS SEPERTI FIELD YANG AKAN DI RETURN
|
||||
err = row.Scan(
|
||||
&ret.StaffID,
|
||||
&ret.Nip,
|
||||
&ret.Name,
|
||||
&ret.Email,
|
||||
&ret.PhoneNumber,
|
||||
&ret.IsActive,
|
||||
&ret.IsLogin,
|
||||
&ret.Token,
|
||||
&ret.IDGoogleSignIn,
|
||||
&ret.CreatedAt,
|
||||
&ret.LastUpdatedAt,
|
||||
)
|
||||
|
||||
// check data
|
||||
|
||||
if err != nil {
|
||||
log.Printf("Error employee_id select: %v", err)
|
||||
log.Printf("Executing query: %s\n", q)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
if err == sql.ErrNoRows {
|
||||
return nil, fmt.Errorf("RECORD_STAFF_LOGIN_ATTENDANCE_NOT_FOUND")
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// hasil return nya
|
||||
return &ret, err
|
||||
}
|
||||
Reference in New Issue
Block a user