Bladeren bron

更新定时任务

yuliang1112 2 jaren geleden
bovenliggende
commit
426f04a90f

+ 34 - 0
db/auto_task.go

@@ -0,0 +1,34 @@
+package db
+
+import (
+	"context"
+	"time"
+	"youngee_b_api/model/gorm_model"
+
+	log "github.com/sirupsen/logrus"
+)
+
+func AutoUpdateStatus() error {
+	db := GetReadDB(context.Background())
+	// 查询task表信息
+	db = db.Debug().Model(gorm_model.ProjectInfo{}).
+		Where("project_status = ? AND recruit_ddl < ?", 4, time.Now())
+	err := db.Update("project_status", 6).Error
+	if err != nil {
+		log.Println("DB AutoUpdateStatus error :", err)
+		return err
+	}
+	return nil
+}
+
+func AutoUpdateApplyTimes() error {
+	db := GetReadDB(context.Background())
+	// 查询task表信息
+	db = db.Debug().Model(gorm_model.YoungeeTalentInfo{})
+	err := db.Update("apply_num", 5).Error
+	if err != nil {
+		log.Println("DB AutoUpdateStatus error :", err)
+		return err
+	}
+	return nil
+}

+ 12 - 6
db/project.go

@@ -4,8 +4,10 @@ import (
 	"context"
 	"fmt"
 	"reflect"
+	"strconv"
 	"youngee_b_api/model/common_model"
 	"youngee_b_api/model/gorm_model"
+	"youngee_b_api/model/http_model"
 	"youngee_b_api/pack"
 	"youngee_b_api/util"
 
@@ -72,7 +74,7 @@ func GetFullProjectList(ctx context.Context, enterpriseID int64, pageSize, pageN
 	return fullProjects, total, nil
 }
 
-func GetProjectTaskList(ctx context.Context, projectID string, pageSize, pageNum int64, conditions *common_model.TaskConditions) ([]*gorm_model.ProjectTaskInfo, int64, error) {
+func GetProjectTaskList(ctx context.Context, projectID string, pageSize, pageNum int64, conditions *common_model.TaskConditions) ([]*http_model.ProjectTaskInfo, int64, error) {
 	db := GetReadDB(ctx)
 	// 查询task表信息
 	db = db.Debug().Model(gorm_model.YoungeeTaskInfo{})
@@ -147,10 +149,10 @@ func GetProjectTaskList(ctx context.Context, projectID string, pageSize, pageNum
 	for _, accountInfo := range accountInfos {
 		accountMap[accountInfo.AccountID] = accountInfo
 	}
-	var taskAccounts []*gorm_model.TaskAccount
-	var projectTasks []*gorm_model.ProjectTaskInfo
+	var taskAccounts []*http_model.TaskAccount
+	var projectTasks []*http_model.ProjectTaskInfo
 	for _, accountId := range accountIds {
-		taskAccount := new(gorm_model.TaskAccount)
+		taskAccount := new(http_model.TaskAccount)
 		_, ok := taskMap[accountId]
 		_, ok2 := accountMap[accountId]
 		if ok && ok2 {
@@ -161,7 +163,7 @@ func GetProjectTaskList(ctx context.Context, projectID string, pageSize, pageNum
 	}
 
 	projectTasks = pack.TaskAccountToTaskInfo(taskAccounts)
-	var fullProjectTasks []*gorm_model.ProjectTaskInfo
+	var fullProjectTasks []*http_model.ProjectTaskInfo
 	// 删除只存在于一个表中的元素
 	for i := 0; i < len(projectTasks); i++ {
 		if projectTasks[i].TaskID != 0 {
@@ -214,8 +216,12 @@ func GetRecruitStrategys(ctx context.Context, ProjectID int64) ([]gorm_model.Rec
 func ChangeTaskStatus(ctx context.Context, data []string, taskStatus string) error {
 	db := GetReadDB(ctx)
 	taskInfo := gorm_model.YoungeeTaskInfo{}
+	taskSta, err := strconv.Atoi(taskStatus)
+	if err != nil {
+		return err
+	}
 	if err := db.Debug().Model(&taskInfo).Where("task_id IN ?", data).
-		Updates(gorm_model.YoungeeTaskInfo{TaskStatus: taskStatus}).Error; err != nil {
+		Updates(gorm_model.YoungeeTaskInfo{TaskStatus: taskSta}).Error; err != nil {
 
 		logrus.WithContext(ctx).Errorf("[ChangeTaskStatus] error query mysql total, err:%+v", err)
 		return err

+ 1 - 0
go.mod

@@ -18,6 +18,7 @@ require (
 	github.com/mailru/easyjson v0.7.7 // indirect
 	github.com/mattn/go-isatty v0.0.14 // indirect
 	github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
+	github.com/robfig/cron/v3 v3.0.1
 	github.com/sirupsen/logrus v1.8.1
 	github.com/swaggo/files v0.0.0-20210815190702-a29dd2bc99b2
 	github.com/swaggo/gin-swagger v1.4.1

+ 2 - 0
go.sum

@@ -149,6 +149,8 @@ github.com/otiai10/mint v1.3.3/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH
 github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
 github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
 github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs=
+github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
 github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
 github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8=
 github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE=

+ 5 - 0
main.go

@@ -2,6 +2,7 @@ package main
 
 import (
 	"fmt"
+	"log"
 	"youngee_b_api/config"
 	_ "youngee_b_api/docs"
 	"youngee_b_api/route"
@@ -17,5 +18,9 @@ func main() {
 	mailConfig := "./config/mail.json"
 	service.SMTPMailServiceIstance.Init(mailConfig)
 	addr := fmt.Sprintf("%v:%v", config.Host, config.Port)
+	err := service.AutoTask()
+	if err != nil {
+		log.Println("service AutoTask error:", err)
+	}
 	r.Run(addr) // listen and serve on 0.0.0.0:8080 (for windows "localhost:8080")
 }

+ 25 - 0
model/gorm_model/project_account.go

@@ -0,0 +1,25 @@
+// Code generated by sql2gorm. DO NOT EDIT.
+package gorm_model
+
+import (
+	"time"
+)
+
+type YoungeePlatformAccountInfo struct {
+	AccountID          int       `gorm:"column:account_id;primary_key;AUTO_INCREMENT"`
+	TalentID           string    `gorm:"column:talent_id;NOT NULL"`             // 达人账号id(youngee_talent_info表id值)
+	PlatformID         int       `gorm:"column:platform_id;NOT NULL"`           // 平台id,与third_platform_info中的id相同
+	PlatformNickname   string    `gorm:"column:platform_nickname;NOT NULL"`     // 在平台上的昵称
+	HomePageUrl        string    `gorm:"column:home_page_url;NOT NULL"`         // 主页链接
+	FansCount          int64     `gorm:"column:fans_count;NOT NULL"`            // 粉丝数
+	HomePageCaptureUrl string    `gorm:"column:home_page_capture_url;NOT NULL"` // 主页截图链接
+	BindDate           time.Time `gorm:"column:bind_date;NOT NULL"`             // 绑定时间
+	Deleted            int       `gorm:"column:deleted;default:0"`              // 是否被解绑
+	UpdatedAt          time.Time `gorm:"column:updated_at"`                     // 更新时间
+	UpdatedPerson      int       `gorm:"column:updated_person"`                 // 更新人,0代表本人,1代表管理员
+	UpdatedAdminID     int       `gorm:"column:updated_admin_id"`               // 上一次更新的管理员id
+}
+
+func (m *YoungeePlatformAccountInfo) TableName() string {
+	return "youngee_platform_account_info"
+}

+ 28 - 0
model/gorm_model/project_task.go

@@ -0,0 +1,28 @@
+// Code generated by sql2gorm. DO NOT EDIT.
+package gorm_model
+
+import (
+	"time"
+)
+
+type YoungeeTaskInfo struct {
+	TaskID                 int       `gorm:"column:task_id;primary_key;AUTO_INCREMENT"` // 任务id
+	ProjectID              int       `gorm:"column:project_id;NOT NULL"`                // 项目id
+	AccountID              int       `gorm:"column:account_id;NOT NULL"`                // 账号id
+	TalentPlatformInfoSnap string    `gorm:"column:talent_platform_info_snap;NOT NULL"` // 达人平台信息快照
+	TalentPersonalInfoSnap string    `gorm:"column:talent_personal_info_snap;NOT NULL"` // 达人个人信息快照
+	TalentPostAddrSnap     string    `gorm:"column:talent_post_addr_snap;NOT NULL"`     // 收货地址快照
+	StrategyID             int       `gorm:"column:strategy_id"`                        // 报名选择的招募策略id
+	TaskReward             int64     `gorm:"column:task_reward"`                        // 任务奖励金额
+	SettleAmount           int64     `gorm:"column:settle_amount;NOT NULL"`             // 待结算金额(任务奖励扣除违规扣款)
+	TaskStatus             int       `gorm:"column:task_status;default:1;NOT NULL"`     // 任务状态 1待选 2已选 3落选
+	CreateDate             time.Time `gorm:"column:create_date;NOT NULL"`               // 创建时间
+	SelectDate             time.Time `gorm:"column:select_date"`                        // 反选时间
+	CompleteStatus         int       `gorm:"column:complete_status;default:1;NOT NULL"` // 结束方式 1未结束 2正常结束 3反选失败 4被解约
+	CompleteDate           time.Time `gorm:"column:complete_date"`                      // 结束时间
+	TaskStage              int       `gorm:"column:task_stage;NOT NULL"`                // 任务阶段
+}
+
+func (m *YoungeeTaskInfo) TableName() string {
+	return "youngee_task_info"
+}

+ 0 - 62
model/gorm_model/project_task_list.go

@@ -1,62 +0,0 @@
-package gorm_model
-
-import (
-	"time"
-)
-
-type YoungeePlatformAccountInfo struct {
-	AccountID          int       `gorm:"column:account_id;primary_key;AUTO_INCREMENT"`
-	TalentID           string    `gorm:"column:talent_id;NOT NULL"`             // 达人账号id(youngee_talent_info表id值)
-	PlatformID         int       `gorm:"column:platform_id;NOT NULL"`           // 平台id,与third_platform_info中的id相同
-	PlatformNickname   string    `gorm:"column:platform_nickname;NOT NULL"`     // 在平台上的昵称
-	HomePageUrl        string    `gorm:"column:home_page_url;NOT NULL"`         // 主页链接
-	FansCount          int64     `gorm:"column:fans_count;NOT NULL"`            // 粉丝数
-	HomePageCaptureUrl string    `gorm:"column:home_page_capture_url;NOT NULL"` // 主页截图链接
-	BindDate           time.Time `gorm:"column:bind_date;NOT NULL"`             // 绑定时间
-	Deleted            int       `gorm:"column:deleted;default:0"`              // 是否被解绑
-	UpdatedAt          time.Time `gorm:"column:updated_at"`                     // 更新时间
-	UpdatedPerson      int       `gorm:"column:updated_person"`                 // 更新人,0代表本人,1代表管理员
-	UpdatedAdminID     int       `gorm:"column:updated_admin_id"`               // 上一次更新的管理员id
-}
-type YoungeeTaskInfo struct {
-	TaskID                 int       `gorm:"column:task_id;primary_key;AUTO_INCREMENT"` // 任务id
-	ProjectID              int       `gorm:"column:project_id;NOT NULL"`                // 项目id
-	AccountID              int       `gorm:"column:account_id;NOT NULL"`                // 账号id
-	TalentPlatformInfoSnap string    `gorm:"column:talent_platform_info_snap;NOT NULL"` // 达人平台信息快照
-	TalentPersonalInfoSnap string    `gorm:"column:talent_personal_info_snap;NOT NULL"` // 达人个人信息快照
-	TalentPostAddrSnap     string    `gorm:"column:talent_post_addr_snap;NOT NULL"`     // 收货地址快照
-	StrategyID             int       `gorm:"column:strategy_id"`                        // 报名选择的招募策略id
-	TaskReward             int64     `gorm:"column:task_reward"`                        // 任务奖励金额
-	SettleAmount           int64     `gorm:"column:settle_amount;NOT NULL"`             // 待结算金额(任务奖励扣除违规扣款)
-	TaskStatus             string    `gorm:"column:task_status;default:1;NOT NULL"`     // 任务状态 1待选 2已选 3落选
-	CreateDate             time.Time `gorm:"column:create_date;NOT NULL"`               // 创建时间
-	SelectDate             time.Time `gorm:"column:select_date"`                        // 反选时间
-	CompleteStatus         int       `gorm:"column:complete_status;default:1;NOT NULL"` // 结束方式 1未结束 2正常结束 3反选失败 4被解约
-	CompleteDate           time.Time `gorm:"column:complete_date"`                      // 结束时间
-	TaskStage              int       `gorm:"column:task_stage;NOT NULL"`                // 任务阶段
-}
-
-type ProjectTaskInfo struct {
-	TaskID             int       `json:"task_id"`               // 任务id
-	PlatformNickname   string    `json:"platform_nickname"`     // 在平台上的昵称
-	FansCount          int64     `json:"fans_count"`            // 粉丝数
-	HomePageCaptureUrl string    `json:"home_page_capture_url"` // 主页截图链接
-	StrategyID         int       `json:"strategy_id"`           // 报名选择的招募策略id
-	TaskReward         int64     `json:"task_reward"`           // 任务奖励金额
-	HomePageUrl        string    `json:"home_page_url"`         // 主页链接
-	TaskStatus         string    `json:"task_status"`           // 任务状态 1待选 2已选 3落选
-	CreateDate         time.Time `json:"create_date"`           // 创建时间
-}
-
-type TaskAccount struct {
-	Task    YoungeeTaskInfo
-	Account YoungeePlatformAccountInfo
-}
-
-func (m *YoungeeTaskInfo) TableName() string {
-	return "youngee_task_info"
-}
-
-func (m *YoungeePlatformAccountInfo) TableName() string {
-	return "youngee_platform_account_info"
-}

+ 37 - 0
model/gorm_model/talent.go

@@ -0,0 +1,37 @@
+// Code generated by sql2gorm. DO NOT EDIT.
+package gorm_model
+
+import (
+	"time"
+)
+
+type YoungeeTalentInfo struct {
+	ID                string    `gorm:"column:id;primary_key"`               // 达人id
+	TalentWxOpenid    string    `gorm:"column:talent_wx_openid;NOT NULL"`    // 达人的微信openid
+	TalentWxNickname  string    `gorm:"column:talent_wx_nickname"`           // 达人的微信昵称
+	TalentWxNumber    string    `gorm:"column:talent_wx_number"`             // 达人微信号
+	Income            int64     `gorm:"column:income;default:0"`             // 收益总数
+	Withdrawing       int64     `gorm:"column:withdrawing;default:0"`        // 提现中金额
+	Canwithdraw       int64     `gorm:"column:canwithdraw;default:0"`        // 可提现金额
+	Withdrawed        int64     `gorm:"column:withdrawed;default:0"`         // 已提现金额
+	TalentGender      int       `gorm:"column:talent_gender"`                // 性别,0未知 1男 2女
+	TalentPhoneNumber string    `gorm:"column:talent_phone_number"`          // 电话号码
+	TalentAgeBracket  int       `gorm:"column:talent_age_bracket"`           // 年龄段,取tallent_age_bracket表id
+	TalentNationality int       `gorm:"column:talent_nationality"`           // 国籍,取tallent_nationality表id
+	VisitStoreRegion  int       `gorm:"column:visit_store_region"`           // 探店区域,取region_info表中的self_code
+	IsBindInfo        uint      `gorm:"column:is_bind_info;default:0"`       // 是否填写个人资料
+	IsBindLocation    uint      `gorm:"column:is_bind_location;default:0"`   // 是否绑定收货地址
+	IsBindBank        uint      `gorm:"column:is_bind_bank;default:0"`       // 是否绑定银行账户信息
+	InBlacklist       uint      `gorm:"column:in_blacklist;default:0"`       // 是否加入黑名单 0否 1是
+	TaskAll           int       `gorm:"column:task_all;default:0"`           // 任务总数
+	TaskApply         int       `gorm:"column:task_apply;default:0"`         // 报名任务数量
+	TaskExecute       int       `gorm:"column:task_execute;default:0"`       // 执行中任务数量
+	TaskEnd           int       `gorm:"column:task_end;default:0"`           // 结束任务数量
+	CreateDate        time.Time `gorm:"column:create_date;NOT NULL"`         // 创建时间
+	LastLoginDate     time.Time `gorm:"column:last_login_date;NOT NULL"`     // 最后登录时间
+	ApplyNum          int       `gorm:"column:apply_num;default:5;NOT NULL"` // 剩余申请次数(每天更新)
+}
+
+func (m *YoungeeTalentInfo) TableName() string {
+	return "youngee_talent_info"
+}

+ 0 - 5
model/http_model/project_change_taskStatus.go

@@ -5,11 +5,6 @@ type ProjectChangeTaskStatusRequest struct {
 	TaskStatus string   `json:"task_status"`
 }
 
-//
-//type TaskIds struct {
-//	TaskId string `json:"taskId"`
-//}
-
 func NewProjectChangeTaskStatusRequst() *ProjectChangeTaskStatusRequest {
 	return new(ProjectChangeTaskStatusRequest)
 }

+ 22 - 0
model/http_model/project_taskList.go

@@ -1,5 +1,10 @@
 package http_model
 
+import (
+	"time"
+	"youngee_b_api/model/gorm_model"
+)
+
 type ProjectTaskListRequest struct {
 	PageSize         int64  `json:"page_size"`
 	PageNum          int64  `json:"page_num"`
@@ -22,6 +27,23 @@ type ProjectTaskPreview struct {
 	CreateDate         string `json:"create_date"`           // 创建时间
 }
 
+type ProjectTaskInfo struct {
+	TaskID             int       `json:"task_id"`               // 任务id
+	PlatformNickname   string    `json:"platform_nickname"`     // 在平台上的昵称
+	FansCount          int64     `json:"fans_count"`            // 粉丝数
+	HomePageCaptureUrl string    `json:"home_page_capture_url"` // 主页截图链接
+	StrategyID         int       `json:"strategy_id"`           // 报名选择的招募策略id
+	TaskReward         int64     `json:"task_reward"`           // 任务奖励金额
+	HomePageUrl        string    `json:"home_page_url"`         // 主页链接
+	TaskStatus         string    `json:"task_status"`           // 任务状态 1待选 2已选 3落选
+	CreateDate         time.Time `json:"create_date"`           // 创建时间
+}
+
+type TaskAccount struct {
+	Task    gorm_model.YoungeeTaskInfo
+	Account gorm_model.YoungeePlatformAccountInfo
+}
+
 type ProjectTaskListData struct {
 	ProjectTaskPreview []*ProjectTaskPreview `json:"project_task_pre_view"`
 	Total              string                `json:"total"`

+ 7 - 8
pack/project_task_list.go

@@ -1,13 +1,12 @@
 package pack
 
 import (
-	"youngee_b_api/model/gorm_model"
 	"youngee_b_api/model/http_model"
 
 	"github.com/issue9/conv"
 )
 
-func MGormProjectTaskToHttpProjectTaskPreview(gormProjectTaskInfos []*gorm_model.ProjectTaskInfo) []*http_model.ProjectTaskPreview {
+func MGormProjectTaskToHttpProjectTaskPreview(gormProjectTaskInfos []*http_model.ProjectTaskInfo) []*http_model.ProjectTaskPreview {
 	var httpProjectPreviews []*http_model.ProjectTaskPreview
 	for _, gormProjectTaskInfo := range gormProjectTaskInfos {
 		httpProjectTaskPreview := GormFullProjectToHttpProjectTaskPreview(gormProjectTaskInfo)
@@ -16,7 +15,7 @@ func MGormProjectTaskToHttpProjectTaskPreview(gormProjectTaskInfos []*gorm_model
 	return httpProjectPreviews
 }
 
-func GormFullProjectToHttpProjectTaskPreview(projectTaskInfo *gorm_model.ProjectTaskInfo) *http_model.ProjectTaskPreview {
+func GormFullProjectToHttpProjectTaskPreview(projectTaskInfo *http_model.ProjectTaskInfo) *http_model.ProjectTaskPreview {
 	createDate := conv.MustString(projectTaskInfo.CreateDate)
 	createDate = createDate[0:19]
 	return &http_model.ProjectTaskPreview{
@@ -32,8 +31,8 @@ func GormFullProjectToHttpProjectTaskPreview(projectTaskInfo *gorm_model.Project
 	}
 }
 
-func TaskAccountToTaskInfo(taskAccounts []*gorm_model.TaskAccount) []*gorm_model.ProjectTaskInfo {
-	var projectTasks []*gorm_model.ProjectTaskInfo
+func TaskAccountToTaskInfo(taskAccounts []*http_model.TaskAccount) []*http_model.ProjectTaskInfo {
+	var projectTasks []*http_model.ProjectTaskInfo
 	for _, taskAccount := range taskAccounts {
 		projectTask := GetTaskInfoStruct(taskAccount)
 		projectTasks = append(projectTasks, projectTask)
@@ -41,8 +40,8 @@ func TaskAccountToTaskInfo(taskAccounts []*gorm_model.TaskAccount) []*gorm_model
 	return projectTasks
 }
 
-func GetTaskInfoStruct(taskAccount *gorm_model.TaskAccount) *gorm_model.ProjectTaskInfo {
-	return &gorm_model.ProjectTaskInfo{
+func GetTaskInfoStruct(taskAccount *http_model.TaskAccount) *http_model.ProjectTaskInfo {
+	return &http_model.ProjectTaskInfo{
 		TaskID:             taskAccount.Task.TaskID,
 		TaskReward:         taskAccount.Task.TaskReward,
 		PlatformNickname:   taskAccount.Account.PlatformNickname,
@@ -50,7 +49,7 @@ func GetTaskInfoStruct(taskAccount *gorm_model.TaskAccount) *gorm_model.ProjectT
 		HomePageUrl:        taskAccount.Account.HomePageUrl,
 		HomePageCaptureUrl: taskAccount.Account.HomePageCaptureUrl,
 		FansCount:          taskAccount.Account.FansCount,
-		TaskStatus:         taskAccount.Task.TaskStatus,
+		TaskStatus:         string(rune(taskAccount.Task.TaskStatus)),
 		StrategyID:         taskAccount.Task.StrategyID,
 	}
 }

+ 41 - 0
service/autoTask.go

@@ -0,0 +1,41 @@
+package service
+
+import (
+	"time"
+	"youngee_b_api/db"
+
+	"github.com/robfig/cron/v3"
+	log "github.com/sirupsen/logrus"
+)
+
+func AutoTask() error {
+	c := cron.New()
+	_, err1 := c.AddFunc("@midnight", AutoTaskUpdateStatus)
+	if err1 != nil {
+		log.Println("service [AutoTaskUpdateStatus] error:", err1)
+		return err1
+	}
+	_, err2 := c.AddFunc("@midnight", AutoTaskUpdateApplyTimes)
+	if err2 != nil {
+		log.Println("service [AutoTaskUpdateApplyTimes] error:", err2)
+		return err2
+	}
+	c.Start()
+	return nil
+}
+
+func AutoTaskUpdateStatus() {
+	err := db.AutoUpdateStatus()
+	log.Println("AutoTaskUpdateStatus is running ,Time :", time.Now())
+	if err != nil {
+		log.Println("AutoTaskUpdateStatus error : ", err)
+	}
+}
+
+func AutoTaskUpdateApplyTimes() {
+	err := db.AutoUpdateApplyTimes()
+	log.Println("AutoUpdateApplyTimes is running ,Time :", time.Now())
+	if err != nil {
+		log.Println("AutoUpdateApplyTimes error : ", err)
+	}
+}

+ 0 - 7
service/project.go

@@ -246,13 +246,6 @@ func (*project) GetPorjectDetail(ctx context.Context, projectID int64) (*http_mo
 }
 
 func (*project) ChangeTaskStatus(ctx *gin.Context, data http_model.ProjectChangeTaskStatusRequest) interface{} {
-	//var taskIds []string
-	//for _, taskId := range data.TaskIds {
-	//	TaskIds := http_model.TaskIds{
-	//		TaskId: taskId.TaskId,
-	//	}
-	//	taskIds = append(taskIds, TaskIds.TaskId)
-	//}
 	err := db.ChangeTaskStatus(ctx, data.TaskIds, data.TaskStatus)
 	if err != nil {
 		logrus.WithContext(ctx).Errorf("[project service] call ChangeTaskStatus error,err:%+v", err)