Your Name 2024-07-21 09:17:50 +08:00
parent 5486729304
commit f8387b3f2a
3 changed files with 5 additions and 3 deletions

View File

@ -6,6 +6,8 @@ USER root
COPY udeskstate /usr/local/bin/
COPY ./email.json /conf/
COPY ./wechatwebhook.json /conf/
COPY ./standby.xlsx /conf/
# 设置执行权限
RUN chmod +x /usr/local/bin/udeskstate

View File

@ -16,7 +16,7 @@ type webHook struct {
}
func getWebhook() string {
wb, err := os.ReadFile("./wechatwebhook.json")
wb, err := os.ReadFile("/conf/wechatwebhook.json")
fmt.Println(string(wb))
if err != nil {
log.Printf("打开webhook文件失败:%v\n", err)

View File

@ -21,13 +21,13 @@ func main() {
// 定义执行的job
func job() {
fmt.Println("任务开始")
remindList, closeList, err := exceldeal.GetSheetName("./standby.xlsx")
remindList, closeList, err := exceldeal.GetSheetName("/rota/standby.xlsx")
if err != nil {
log.Fatalf("打开值班表失败:%v", err)
}
log.Println("应在线人员名字:", remindList)
log.Println("应离线人员名字:", closeList)
remindEmail, closeEmail := exceldeal.JsonDeal("./email.json", remindList, closeList)
remindEmail, closeEmail := exceldeal.JsonDeal("/conf/email.json", remindList, closeList)
log.Println("应在线人员邮箱:", remindEmail)
log.Println("应离线人员邮箱:", closeEmail)