diff --git a/common/config/config.go b/common/config/config.go index 604d800..ac8de47 100644 --- a/common/config/config.go +++ b/common/config/config.go @@ -39,6 +39,7 @@ type QyWeixin struct { Corpid string `toml:"corpid"` CheckinAgent string `toml:"checkin_agent"` CheckinSecret string `toml:"checkin_secret"` + CheckinGroup string `toml:"checkin_group"` EnterpriseAgent string `toml:"enterprise_agent"` EnterpriseSecret string `toml:"enterprise_secret"` HrAgent string `toml:"hr_agent"` diff --git a/conf/server.conf.dev b/conf/server.conf.dev index 56becad..e638e97 100644 --- a/conf/server.conf.dev +++ b/conf/server.conf.dev @@ -23,3 +23,4 @@ enterprise_agent = "1000009" enterprise_secret = "oMB24UhKe50-XPTg7vhnwoTuhEXaq5XeiHPAUtF4hOs" checkin_agent = "3010011" checkin_secret = "6ljYNGt4DonZLmr9SCtgkTlOvtqmsOchBrTWwGl_GpU" +checkin_group = "1,2" \ No newline at end of file diff --git a/conf/server.conf.prod b/conf/server.conf.prod index b5aa94e..fc06749 100644 --- a/conf/server.conf.prod +++ b/conf/server.conf.prod @@ -17,4 +17,10 @@ password="" [qyweixin] corpid = "ww43c49db2e88a17f8" +hr_agent = "3010185" +hr_secret = "Ko2UQWZPbdM9N1snukp_1CT_3J7CcReyPAzl3ww2xoo" +enterprise_agent = "1000009" +enterprise_secret = "oMB24UhKe50-XPTg7vhnwoTuhEXaq5XeiHPAUtF4hOs" +checkin_agent = "3010011" checkin_secret = "6ljYNGt4DonZLmr9SCtgkTlOvtqmsOchBrTWwGl_GpU" +checkin_group = "1,2" diff --git a/worker/checkin.go b/worker/checkin.go index 014eb9a..41e6146 100644 --- a/worker/checkin.go +++ b/worker/checkin.go @@ -6,12 +6,13 @@ import ( "enterprise/common/model" "enterprise/common/qyweixin" log "github.com/sirupsen/logrus" + "strings" ) func SyncCheckin(day string) error { cfg := config.GetConfig() qyw := qyweixin.NewQyWeixin(cfg.QyWeixin.Corpid, cfg.QyWeixin.CheckinSecret) - users, err := qyw.GetCheckinEmployee([]string{"1"}) + users, err := qyw.GetCheckinEmployee(strings.Split(cfg.QyWeixin.CheckinGroup, ",")) if err != nil { return err }