소스 검색

Merge branch 'XxY' into develop

Xingyu Xian 6 달 전
부모
커밋
ce53af4274

+ 4 - 4
config/init.go

@@ -2,13 +2,14 @@ package config
 
 import (
 	"fmt"
-	"gopkg.in/yaml.v2"
 	"io/ioutil"
 	"os"
-	"youngee_b_api/app/dao"
+	"youngee_b_api/db"
 	"youngee_b_api/model/system_model"
 	"youngee_b_api/redis"
 	"youngee_b_api/service"
+
+	"gopkg.in/yaml.v2"
 )
 
 func Init() *system_model.Server {
@@ -30,8 +31,7 @@ func Init() *system_model.Server {
 }
 
 func loadExternelConfig(config *system_model.Config) {
-	//db.Init(config.Mysql)
-	dao.Init(config.Mysql)
+	db.Init(config.Mysql)
 	redis.Init(config.Redis)
 	service.LoginAuthInit(config.Server.Session)
 	service.SendCodeInit(config.Server.Session)

+ 0 - 12
db/enterprise.go

@@ -215,15 +215,3 @@ func UpdateEnterprise(ctx context.Context, EnterpriseID string, BusinessName str
 	}
 	return nil
 }
-
-// CreateEnterpriseSubAccount ToDo
-// CreateEnterpriseSubAccount 创建商家子账号
-func CreateEnterpriseSubAccount(ctx context.Context, EnterpriseID string, BusinessName string) error {
-	db := GetReadDB(ctx)
-	err := db.Model(gorm_model.Enterprise{}).Where("enterprise_id=?", EnterpriseID).Update("business_name", BusinessName).Error
-	if err != nil {
-		fmt.Println("Update Enterprise Failed!")
-		return err
-	}
-	return nil
-}

+ 76 - 0
db/job.go

@@ -0,0 +1,76 @@
+package db
+
+import (
+	"context"
+	"youngee_b_api/model/gorm_model"
+)
+
+// CreateJob 新建岗位
+func CreateJob(ctx context.Context, job gorm_model.YounggeeJob) error {
+	db := GetWriteDB(ctx)
+	err := db.Create(&job).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+// UpdateJob 更新岗位
+func UpdateJob(ctx context.Context, job gorm_model.YounggeeJob) error {
+	db := GetWriteDB(ctx)
+	whereCondition := gorm_model.YounggeeJob{JobId: job.JobId}
+	err := db.Model(&gorm_model.YounggeeJob{}).Where(whereCondition).Updates(job).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+// DeleteJob 删除岗位
+func DeleteJob(ctx context.Context, job gorm_model.YounggeeJob) error {
+	db := GetWriteDB(ctx)
+	whereCondition := gorm_model.YounggeeJob{JobId: job.JobId}
+	err := db.Where(whereCondition).Delete(&gorm_model.YounggeeJob{}).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+// FindJobByEnterpriseId 按商家ID查找岗位信息
+func FindJobByEnterpriseId(ctx context.Context, job gorm_model.YounggeeJob) ([]*gorm_model.YounggeeJob, error) {
+	db := GetReadDB(ctx)
+	var Jobs []*gorm_model.YounggeeJob
+	whereCondition := gorm_model.YounggeeJob{EnterpriseId: job.EnterpriseId}
+	err := db.Model(gorm_model.YounggeeJob{}).Where(whereCondition).Find(&Jobs).Error
+	if err != nil {
+		return nil, err
+	}
+	return Jobs, nil
+}
+
+// FindJobByJobId 按照岗位Id查找岗位信息
+func FindJobByJobId(ctx context.Context, jobId int) (*gorm_model.YounggeeJob, error) {
+	db := GetReadDB(ctx)
+	var Job *gorm_model.YounggeeJob
+	whereCondition := gorm_model.YounggeeJob{JobId: jobId}
+	err := db.Model(gorm_model.YounggeeJob{}).Where(whereCondition).Find(&Job).Error
+	if err != nil {
+		return nil, err
+	}
+	return Job, nil
+}
+
+/*
+func GetRewardStrategyBySelectionId(ctx context.Context, SelectionId string) ([]*gorm_model.RewardStrategy, error) {
+	db := GetReadDB(ctx)
+	var RewardStrategys []*gorm_model.RewardStrategy
+	err := db.Model(gorm_model.RewardStrategy{}).Where("selection_id = ?", SelectionId).Find(&RewardStrategys).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[GetRewardStrategyBySelectionId] error query, err:%+v", err)
+		return nil, err
+	}
+	return RewardStrategys, nil
+}
+
+*/

+ 36 - 14
db/sectask.go

@@ -32,31 +32,50 @@ func GetSecTaskById(ctx context.Context, secTaskId string) (*gorm_model.Younggee
 
 func GetSecTaskList(ctx context.Context, selectionId string, taskStatus int, searchValue string, pageSize, pageNum int64) ([]*http_model.SecTaskInfo, int64, error) {
 	db := GetReadDB(ctx)
-	var taskStages []int
+	// var taskStages []int
+	var freeStages []int
+	var rewardStages []int
 	switch taskStatus {
 	case 3:
-		taskStages = []int{3}
+		// 待选
+		freeStages = []int{1}
 		break
 	case 4:
-		taskStages = []int{4, 6, 7, 8, 9, 10}
+		// 申请成功
+		freeStages = []int{3, 4, 5}
 		break
 	case 6:
-		taskStages = []int{6}
+		// 待发货
+		freeStages = []int{3}
 		break
 	case 7:
-		taskStages = []int{7}
+		// 已发货
+		freeStages = []int{4}
 		break
 	case 8:
-		taskStages = []int{8, 9, 10}
+		// 已收货
+		freeStages = []int{5}
 	case 9:
-		taskStages = []int{9}
+		// 待领悬赏
+		rewardStages = []int{1}
 		break
 	case 10:
-		taskStages = []int{10}
+		// 已领悬赏
+		rewardStages = []int{2}
 		break
+	case 11:
+		// 返回全部 使用场景-绑定免费领样策略
+		freeStages = []int{0, 1, 2, 3, 4, 5}
+		rewardStages = []int{0, 1}
+	}
+	fmt.Println("task_stages: ", freeStages, rewardStages)
+	if len(freeStages) == 0 {
+		// 根据悬赏阶段筛选
+		db = db.Model(gorm_model.YounggeeSecTaskInfo{}).Where("selection_id = ? and reward_stage in ?", selectionId, rewardStages)
+	} else {
+		// 根据免费领样阶段筛选
+		db = db.Model(gorm_model.YounggeeSecTaskInfo{}).Where("selection_id = ? and free_stage in ?", selectionId, freeStages)
 	}
-	db = db.Model(gorm_model.YounggeeSecTaskInfo{}).Where("selection_id = ? and task_stage in ?", selectionId, taskStages)
-
 	// 查询总数
 	var total int64
 	var secTaskInfoList []*gorm_model.YounggeeSecTaskInfo
@@ -105,7 +124,7 @@ func PassSecTaskCoop(ctx context.Context, selectionId string, taskIds []string)
 	// 1. 校验
 	var count int64
 	fmt.Println("task_ids: ", taskIds)
-	err := db.Model(gorm_model.YounggeeSecTaskInfo{}).Where("task_id IN ? AND task_stage = 3", taskIds).Count(&count).Error
+	err := db.Model(gorm_model.YounggeeSecTaskInfo{}).Where("task_id IN ? AND free_stage = 1", taskIds).Count(&count).Error
 
 	fmt.Println("count: ", count)
 	if err != nil {
@@ -149,13 +168,15 @@ func PassSecTaskCoop(ctx context.Context, selectionId string, taskIds []string)
 				return err
 			}
 		} else {
+			// 免费领样
 			updateData := gorm_model.YounggeeSecTaskInfo{
 				TaskStatus:      2,
 				TaskStage:       6,
 				SelectDate:      time.Now(),
 				LogisticsStatus: 1,
+				FreeStage:       3,
 			}
-			err = tx.Model(gorm_model.YounggeeSecTaskInfo{}).Where("task_id IN ? AND task_stage = 3", taskIds).Updates(updateData).Error
+			err = tx.Model(gorm_model.YounggeeSecTaskInfo{}).Where("task_id IN ? AND free_stage = 1", taskIds).Updates(updateData).Error
 			if err != nil {
 				return err
 			}
@@ -187,7 +208,7 @@ func RefuseSecTaskCoop(ctx context.Context, taskIds []string) (bool, error) {
 	db := GetWriteDB(ctx)
 	// 1. 校验
 	var count int64
-	err := db.Model(gorm_model.YounggeeSecTaskInfo{}).Where("task_id IN ? AND task_stage = 3", taskIds).Count(&count).Error
+	err := db.Model(gorm_model.YounggeeSecTaskInfo{}).Where("task_id IN ? AND free_stage = 1", taskIds).Count(&count).Error
 	if err != nil {
 		return false, err
 	}
@@ -209,8 +230,9 @@ func RefuseSecTaskCoop(ctx context.Context, taskIds []string) (bool, error) {
 			TaskStage:      5,
 			CompleteDate:   time.Now(),
 			CompleteStatus: 3,
+			FreeStage:      2,
 		}
-		err = tx.Model(gorm_model.YounggeeSecTaskInfo{}).Where("task_id IN ? AND task_stage = 3", taskIds).Updates(updateData).Error
+		err = tx.Model(gorm_model.YounggeeSecTaskInfo{}).Where("task_id IN ? AND free_stage = 1", taskIds).Updates(updateData).Error
 		if err != nil {
 			return err
 		}

+ 1 - 0
db/selection.go

@@ -251,6 +251,7 @@ func UpdateSelectionSettleMoney(ctx context.Context, selectionID string, payMone
 func GetSelectionInfoList(ctx context.Context, pageNum, pageSize int64, conditions http_model.SelectionSquareCondition) ([]*http_model.SelectionBriefInfo, int64, error) {
 	db := GetReadDB(ctx)
 	db = db.Debug().Model(gorm_model.YounggeeSelectionInfo{}).Where("selection_status>2")
+	fmt.Println("conditions: ", conditions)
 
 	conditionType := reflect.TypeOf(&conditions).Elem()
 	conditionValue := reflect.ValueOf(&conditions).Elem()

+ 56 - 0
db/sub_account.go

@@ -0,0 +1,56 @@
+package db
+
+import (
+	"context"
+	"fmt"
+	"youngee_b_api/model/gorm_model"
+)
+
+// CreateSubAccount 新建子账号
+func CreateSubAccount(ctx context.Context, account gorm_model.YounggeeSubAccount) error {
+	db := GetWriteDB(ctx)
+	err := db.Create(&account).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+// UpdateSubAccount 更新子账号
+func UpdateSubAccount(ctx context.Context, account gorm_model.YounggeeSubAccount) error {
+	db := GetWriteDB(ctx)
+	whereCondition := gorm_model.YounggeeSubAccount{SubAccountId: account.SubAccountId}
+	err := db.Model(&gorm_model.YounggeeSubAccount{}).Where(whereCondition).Updates(account).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+// DeleteSubAccount 删除子账号
+func DeleteSubAccount(ctx context.Context, account gorm_model.YounggeeSubAccount) error {
+	db := GetWriteDB(ctx)
+	whereCondition := gorm_model.YounggeeSubAccount{SubAccountId: account.SubAccountId}
+	err := db.Where(whereCondition).Delete(&gorm_model.YounggeeSubAccount{}).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+// FindSubAccountByPhone 根据手机号码查询子账号
+func FindSubAccountByPhone(ctx context.Context, phone string) (*gorm_model.YounggeeSubAccount, error) {
+	db := GetReadDB(ctx)
+	var total int64
+	var subAccount *gorm_model.YounggeeSubAccount
+	whereCondition := gorm_model.YounggeeSubAccount{PhoneNumber: phone, SubAccountType: 1}
+	err := db.Model(gorm_model.YounggeeSubAccount{}).Where(whereCondition).Find(&subAccount).Count(&total).Error
+	if err != nil {
+		return nil, err
+	}
+	fmt.Println(total)
+	if total == 0 {
+		return nil, err
+	}
+	return subAccount, nil
+}

+ 18 - 4
db/user.go

@@ -3,9 +3,8 @@ package db
 import (
 	"context"
 	"fmt"
-	"youngee_b_api/model/gorm_model"
-
 	"gorm.io/gorm"
+	"youngee_b_api/model/gorm_model"
 )
 
 func CreateUser(ctx context.Context, user gorm_model.YounggeeUser) (*int64, error) {
@@ -17,11 +16,26 @@ func CreateUser(ctx context.Context, user gorm_model.YounggeeUser) (*int64, erro
 	return &user.ID, nil
 }
 
-// GetUserByPhone 查不到返回空 根据手机号在User表中查用户数据
+// GetUserByPhone 查不到返回空 根据手机号在User表中查商家用户数据
 func GetUserByPhone(ctx context.Context, phone string) (*gorm_model.YounggeeUser, error) {
 	db := GetReadDB(ctx)
 	user := &gorm_model.YounggeeUser{}
-	err := db.Model(user).Where("phone = ?", phone).First(user).Error
+	err := db.Model(user).Where("phone = ? AND role = 3", phone).First(user).Error
+	if err != nil {
+		if err == gorm.ErrRecordNotFound {
+			fmt.Println("record not found")
+			return nil, nil
+		}
+		return nil, err
+	}
+	return user, nil
+}
+
+// GetSubUserByPhone 根据手机号在user表中查找子账号用户
+func GetSubUserByPhone(ctx context.Context, phone string) (*gorm_model.YounggeeUser, error) {
+	db := GetReadDB(ctx)
+	user := &gorm_model.YounggeeUser{}
+	err := db.Model(user).Where("phone = ? AND role = 4", phone).First(user).Error
 	if err != nil {
 		if err == gorm.ErrRecordNotFound {
 			fmt.Println("record not found")

+ 87 - 5
go.mod

@@ -1,6 +1,8 @@
 module youngee_b_api
 
-go 1.16
+go 1.22.1
+
+toolchain go1.22.3
 
 require (
 	github.com/GUAIK-ORG/go-snowflake v0.0.0-20200116064823-220c4260e85f
@@ -9,14 +11,91 @@ require (
 )
 
 require (
+	github.com/BurntSushi/toml v0.3.1 // indirect
+	github.com/KyleBanks/depth v1.2.1 // indirect
 	github.com/PuerkitoBio/purell v1.1.1 // indirect
+	github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
+	github.com/agiledragon/gomonkey v2.0.2+incompatible // indirect
+	github.com/agiledragon/gomonkey/v2 v2.3.1 // indirect
+	github.com/cespare/xxhash/v2 v2.1.2 // indirect
+	github.com/chzyer/logex v1.1.10 // indirect
+	github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e // indirect
+	github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 // indirect
+	github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d // indirect
+	github.com/creack/pty v1.1.9 // indirect
+	github.com/davecgh/go-spew v1.1.1 // indirect
+	github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
+	github.com/fsnotify/fsnotify v1.4.9 // indirect
+	github.com/ghodss/yaml v1.0.0 // indirect
+	github.com/gin-contrib/gzip v0.0.3 // indirect
+	github.com/gin-contrib/sse v0.1.0 // indirect
+	github.com/go-openapi/jsonpointer v0.19.5 // indirect
+	github.com/go-openapi/jsonreference v0.19.6 // indirect
+	github.com/go-openapi/spec v0.20.4 // indirect
+	github.com/go-playground/assert/v2 v2.0.1 // indirect
+	github.com/go-playground/locales v0.14.0 // indirect
+	github.com/go-playground/universal-translator v0.18.0 // indirect
+	github.com/go-sql-driver/mysql v1.6.0 // indirect
+	github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 // indirect
+	github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect
+	github.com/golang/protobuf v1.5.2 // indirect
+	github.com/google/go-cmp v0.5.5 // indirect
+	github.com/google/gofuzz v1.0.0 // indirect
+	github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 // indirect
+	github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 // indirect
+	github.com/hpcloud/tail v1.0.0 // indirect
+	github.com/huaweicloud/huaweicloud-sdk-go-v3 v0.1.115 // indirect
+	github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639 // indirect
+	github.com/issue9/assert/v2 v2.0.0 // indirect
+	github.com/jinzhu/inflection v1.0.0 // indirect
+	github.com/josharian/intern v1.0.0 // indirect
+	github.com/jtolds/gls v4.20.0+incompatible // indirect
+	github.com/kr/pretty v0.3.0 // indirect
+	github.com/kr/pty v1.1.1 // indirect
+	github.com/kr/text v0.2.0 // indirect
+	github.com/leodido/go-urn v1.2.1 // indirect
+	github.com/lin-jim-leon/kuaishou v0.3.0 // indirect
+	github.com/modern-go/reflect2 v1.0.2 // indirect
+	github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
+	github.com/nxadm/tail v1.4.8 // indirect
+	github.com/onsi/ginkgo v1.16.5 // indirect
+	github.com/onsi/ginkgo/v2 v2.0.0 // indirect
+	github.com/onsi/gomega v1.18.1 // indirect
+	github.com/otiai10/copy v1.7.0 // indirect
+	github.com/otiai10/curr v1.0.0 // indirect
+	github.com/otiai10/mint v1.3.3 // indirect
+	github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e // indirect
+	github.com/pmezard/go-difflib v1.0.0 // indirect
+	github.com/rogpeppe/go-internal v1.8.0 // indirect
+	github.com/russross/blackfriday/v2 v2.0.1 // indirect
+	github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
+	github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d // indirect
+	github.com/smartystreets/goconvey v1.6.4 // indirect
+	github.com/stretchr/objx v0.5.0 // indirect
+	github.com/stretchr/testify v1.8.4 // indirect
+	github.com/tidwall/match v1.1.1 // indirect
+	github.com/tidwall/pretty v1.2.0 // indirect
+	github.com/ugorji/go/codec v1.2.7 // indirect
+	github.com/urfave/cli/v2 v2.3.0 // indirect
+	github.com/yuin/goldmark v1.4.13 // indirect
+	golang.org/x/mod v0.8.0 // indirect
+	golang.org/x/sync v0.1.0 // indirect
+	golang.org/x/term v0.20.0 // indirect
+	golang.org/x/text v0.15.0 // indirect
+	golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
+	gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
+	gopkg.in/errgo.v2 v2.1.0 // indirect
+	gopkg.in/fsnotify.v1 v1.4.7 // indirect
+	gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
+	gopkg.in/yaml.v3 v3.0.1 // indirect
+)
+
+require (
 	github.com/caixw/lib.go v0.0.0-20141220110639-1781da9139e0
 	github.com/go-openapi/swag v0.21.1 // indirect
 	github.com/go-playground/validator/v10 v10.10.1 // indirect
 	github.com/go-redis/redis/v8 v8.11.5
-	github.com/huaweicloud/huaweicloud-sdk-go-v3 v0.1.109 // indirect
 	github.com/issue9/conv v1.2.2
-	github.com/jinzhu/gorm v1.9.16 // indirect
 	github.com/jinzhu/now v1.1.5 // indirect
 	github.com/json-iterator/go v1.1.12 // indirect
 	github.com/mailru/easyjson v0.7.7 // indirect
@@ -25,13 +104,16 @@ require (
 	github.com/robfig/cron/v3 v3.0.1
 	github.com/satori/go.uuid v1.2.0
 	github.com/sirupsen/logrus v1.8.1
-	github.com/swaggo/files v1.0.1
+	github.com/swaggo/files v0.0.0-20210815190702-a29dd2bc99b2
 	github.com/swaggo/gin-swagger v1.4.1
 	github.com/swaggo/swag v1.8.1
 	github.com/tidwall/gjson v1.14.1
 	github.com/ugorji/go v1.2.7 // indirect
 	github.com/wechatpay-apiv3/wechatpay-go v0.2.15
-	golang.org/x/crypto v0.26.0 // indirect
+	golang.org/x/crypto v0.23.0 // indirect
+	golang.org/x/net v0.21.0 // indirect
+	golang.org/x/sys v0.20.0 // indirect
+	golang.org/x/tools v0.6.0 // indirect
 	google.golang.org/protobuf v1.28.0 // indirect
 	gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
 	gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df

+ 7 - 58
go.sum

@@ -4,7 +4,6 @@ github.com/GUAIK-ORG/go-snowflake v0.0.0-20200116064823-220c4260e85f h1:RDkg3pyE
 github.com/GUAIK-ORG/go-snowflake v0.0.0-20200116064823-220c4260e85f/go.mod h1:zA7AF9RTfpluCfz0omI4t5KCMaWHUMicsZoMccnaT44=
 github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc=
 github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE=
-github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc=
 github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI=
 github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
 github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M=
@@ -13,7 +12,6 @@ github.com/agiledragon/gomonkey v2.0.2+incompatible h1:eXKi9/piiC3cjJD1658mEE2o3
 github.com/agiledragon/gomonkey v2.0.2+incompatible/go.mod h1:2NGfXu1a80LLr2cmWXGBDaHEjb1idR6+FVlX5T3D9hw=
 github.com/agiledragon/gomonkey/v2 v2.3.1 h1:k+UnUY0EMNYUFUAQVETGY9uUTxjMdnUkP0ARyJS1zzs=
 github.com/agiledragon/gomonkey/v2 v2.3.1/go.mod h1:ap1AmDzcVOAz1YpeJ3TCzIgstoaWLA6jbbgxfB4w2iY=
-github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y=
 github.com/caixw/lib.go v0.0.0-20141220110639-1781da9139e0 h1:MnIURgMAFAMyxAHu8h2TbnjxMMd7SKVCPyTZz5EfwNA=
 github.com/caixw/lib.go v0.0.0-20141220110639-1781da9139e0/go.mod h1:hQL8hyiiVE/BSo7gh13njx+DpvoPh/yE8/BkKKc62RA=
 github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
@@ -29,15 +27,11 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3
 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
 github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd h1:83Wprp6ROGeiHFAP8WJdI2RoxALQYgdllERc3N5N2DM=
-github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
 github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
 github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
 github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
 github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
 github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
-github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 h1:Yzb9+7DPaBjB8zlTR87/ElzFsnQfuHnVUVqpZZIcV5Y=
-github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0=
 github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
 github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
 github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
@@ -74,12 +68,9 @@ github.com/go-playground/validator/v10 v10.10.1 h1:uA0+amWMiglNZKZ9FJRKUAe9U3RX9
 github.com/go-playground/validator/v10 v10.10.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU=
 github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI=
 github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo=
-github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
 github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE=
 github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
 github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
-github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY=
-github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=
 github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
 github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
 github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
@@ -103,26 +94,21 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
 github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
 github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
 github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
-github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
 github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
 github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
 github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
 github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
 github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
 github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
-github.com/huaweicloud/huaweicloud-sdk-go-v3 v0.1.109 h1:JIuZg7gCEb1R6WDzlpQG3wVtG/V8oR4BZAPgW5T2yDc=
-github.com/huaweicloud/huaweicloud-sdk-go-v3 v0.1.109/go.mod h1:JWz2ujO9X3oU5wb6kXp+DpR2UuDj2SldDbX8T0FSuhI=
+github.com/huaweicloud/huaweicloud-sdk-go-v3 v0.1.115 h1:0i/6REsHzn1KCW7hF0H1XxXibzmY9CuGUkOX71yRNwY=
+github.com/huaweicloud/huaweicloud-sdk-go-v3 v0.1.115/go.mod h1:JWz2ujO9X3oU5wb6kXp+DpR2UuDj2SldDbX8T0FSuhI=
 github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
 github.com/issue9/assert/v2 v2.0.0 h1:vN7fr70g5ND6zM39tPZk/E4WCyjGMqApmFbujSTmEo0=
 github.com/issue9/assert/v2 v2.0.0/go.mod h1:rKr1eVGzXUhAo2af1thiKAhIA8uiSK9Wyn7mcZ4BzAg=
 github.com/issue9/conv v1.2.2 h1:DlvooVwcCgHxGxgVNSt4LFGxIVzWbMV8E2dmQlrGHNA=
 github.com/issue9/conv v1.2.2/go.mod h1:uDqE/xgXbZ5UjC2J5+HLIoguE0qOKGzv7EzLzkvoRPE=
-github.com/jinzhu/gorm v1.9.16 h1:+IyIjPEABKRpsu/F8OvDPy9fyQlgsg2luMV2ZIH5i5o=
-github.com/jinzhu/gorm v1.9.16/go.mod h1:G3LB3wezTOWM2ITLzPxEXgSkOXAntiLHS7UdBefADcs=
 github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
 github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
-github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
 github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
 github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
 github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
@@ -144,8 +130,8 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
 github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII=
 github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w=
 github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY=
-github.com/lib/pq v1.1.1 h1:sJZmqHoEaY7f+NPP8pgLB/WxulyR3fewgCM2qaSlBb4=
-github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
+github.com/lin-jim-leon/kuaishou v0.3.0 h1:Gb0DRc62K51/78680Pq+zupOXTnd1CN1Lfv5NrqRIHo=
+github.com/lin-jim-leon/kuaishou v0.3.0/go.mod h1:BFbAhNC3PUIhAaA9YDSi6WDB0UcRMPS9C7dpFAtENaY=
 github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
 github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
 github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
@@ -154,8 +140,6 @@ github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJ
 github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
 github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y=
 github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
-github.com/mattn/go-sqlite3 v1.14.0 h1:mLyGNKR8+Vv9CAU7PphKa2hkEqxxhn8i32J6FPj1/QA=
-github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus=
 github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
 github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
 github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
@@ -213,12 +197,9 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
 github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
 github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
 github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
-github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
 github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
 github.com/swaggo/files v0.0.0-20210815190702-a29dd2bc99b2 h1:+iNTcqQJy0OZ5jk6a5NLib47eqXK8uYcPX+O4+cBpEM=
 github.com/swaggo/files v0.0.0-20210815190702-a29dd2bc99b2/go.mod h1:lKJPbtWzJ9JhsTN1k1gZgleJWY/cqq0psdoMmaThG3w=
-github.com/swaggo/files v1.0.1 h1:J1bVJ4XHZNq0I46UU90611i9/YzdrF7x92oX1ig5IdE=
-github.com/swaggo/files v1.0.1/go.mod h1:0qXmMNH6sXNf+73t65aKeB+ApmgxdnkQzVTAj2uaMUg=
 github.com/swaggo/gin-swagger v1.4.1 h1:F2vJndw+Q+ZBOlsC6CaodqXJV3ZOf6hpg/4Y6MEx5BM=
 github.com/swaggo/gin-swagger v1.4.1/go.mod h1:hmJ1vPn+XjUvnbzjCdUAxVqgraxELxk8x5zAsjCE5mg=
 github.com/swaggo/swag v1.7.9/go.mod h1:gZ+TJ2w/Ve1RwQsA2IRoSOTidHz6DX+PIG8GWvbnoLU=
@@ -230,7 +211,6 @@ github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
 github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
 github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs=
 github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
-github.com/tjfoc/gmsm v1.4.1 h1:aMe1GlZb+0bLjn+cKTPEvvn9oUEBlJitaZiiBwsbgho=
 github.com/tjfoc/gmsm v1.4.1/go.mod h1:j4INPkHWMrhJb38G+J6W4Tw0AbuN8Thu3PbdVYhVcTE=
 github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw=
 github.com/ugorji/go v1.2.7 h1:qYhyWUUd6WbiM+C6JZAUkIJt/1WrjzNHY9+KCIjVqTo=
@@ -249,12 +229,9 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec
 github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
 github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
 github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
-go.mongodb.org/mongo-driver v1.12.0 h1:aPx33jmn/rQuJXPQLZQ8NtfPQG8CaqgLThFtqRb0PiE=
 go.mongodb.org/mongo-driver v1.12.0/go.mod h1:AZkxhPnFJUoH7kZlFkVKucV20K387miPfm7oimrSmK0=
 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
-golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
 golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
-golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
 golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
 golang.org/x/crypto v0.0.0-20201012173705-84dcc777aaee/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
 golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
@@ -262,11 +239,9 @@ golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0
 golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29 h1:tkVvjkPTB7pnW3jnid7kNyAMPVWllTNOf/qKDze4p9o=
 golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
 golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
-golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
 golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
+golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI=
 golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
-golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw=
-golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54=
 golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
 golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
 golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
@@ -278,11 +253,6 @@ golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2
 golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
 golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8=
 golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
-golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
-golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
-golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA=
-golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
-golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -290,8 +260,6 @@ golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73r
 golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
 golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
 golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
 golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
 golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
 golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
@@ -306,13 +274,9 @@ golang.org/x/net v0.0.0-20220407224826-aac1ed45d8e3 h1:EN5+DfgmRMvRUrMGERW2gQl3V
 golang.org/x/net v0.0.0-20220407224826-aac1ed45d8e3/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
 golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
 golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
-golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
 golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
-golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
 golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=
 golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
-golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=
-golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
 golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
 golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -321,10 +285,6 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ
 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
-golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
-golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
-golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
 golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -353,20 +313,15 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc
 golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
 golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM=
-golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=
 golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
 golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
 golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
 golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
-golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
 golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
 golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
-golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk=
 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
 golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
@@ -376,11 +331,9 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
 golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
 golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
 golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
-golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
 golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
+golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk=
 golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
-golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=
-golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
 golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
 golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
 golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
@@ -395,9 +348,6 @@ golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E
 golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
 golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM=
 golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
-golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
-golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg=
-golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
 golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
@@ -432,7 +382,6 @@ gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
 gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
 gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df h1:n7WqCuqOuCbNr617RXOY0AWRXxgwEyPp2z+p0+hgMuE=
 gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df/go.mod h1:LRQQ+SO6ZHR7tOkpBDuZnXENFzX8qRjMDMyPD6BRkCw=
-gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
 gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
 gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
 gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=

+ 1 - 1
handler/SpecialTaskFinishData.go

@@ -4,7 +4,7 @@ package handler
 // 	"errors"
 // 	"fmt"
 // 	"youngee_b_api/consts"
-// 	"youngee_b_api/entity/http_model"
+// 	"youngee_b_api/model/http_model"
 // 	"youngee_b_api/pack"
 // 	"youngee_b_api/service"
 // 	"youngee_b_api/util"

+ 52 - 0
handler/addNewJob.go

@@ -0,0 +1,52 @@
+package handler
+
+import (
+	"fmt"
+	"github.com/gin-gonic/gin"
+	"youngee_b_api/model/http_model"
+	"youngee_b_api/service"
+)
+
+func WrapaddNewJobHandler(ctx *gin.Context) {
+	handler := newaddNewJobHandler(ctx)
+	baseRun(handler)
+}
+
+func newaddNewJobHandler(ctx *gin.Context) *AddNewJobHandler {
+	return &AddNewJobHandler{
+		req:  http_model.NewAddNewJobRequest(),
+		resp: http_model.NewAddNewJobResponse(),
+		ctx:  ctx,
+	}
+}
+
+type AddNewJobHandler struct {
+	req  *http_model.AddNewJobRequest
+	resp *http_model.CommonResponse
+	ctx  *gin.Context
+}
+
+func (h *AddNewJobHandler) getRequest() interface{} {
+	return h.req
+}
+func (h *AddNewJobHandler) getContext() *gin.Context {
+	return h.ctx
+}
+func (h *AddNewJobHandler) getResponse() interface{} {
+	return h.resp
+}
+func (h *AddNewJobHandler) run() {
+	fmt.Println("AddNewJobHandler Running")
+	// fmt.Println("岗位信息:", h.req)
+	jobData := http_model.AddNewJobRequest{}
+	jobData = *h.req
+	err := service.Job.CreateJob(h.ctx, jobData)
+	if err != nil {
+		fmt.Println(err)
+	}
+	return
+}
+
+func (h *AddNewJobHandler) checkParam() error {
+	return nil
+}

+ 26 - 4
handler/addNewSubAccount.go

@@ -4,6 +4,7 @@ import (
 	"fmt"
 	"github.com/gin-gonic/gin"
 	"youngee_b_api/model/http_model"
+	"youngee_b_api/service"
 )
 
 func WrapAddNewSubAccountHandler(ctx *gin.Context) {
@@ -13,14 +14,14 @@ func WrapAddNewSubAccountHandler(ctx *gin.Context) {
 
 func newAddNewSubAccountHandler(ctx *gin.Context) *AddNewSubAccountHandler {
 	return &AddNewSubAccountHandler{
-		req:  http_model.NewRegisterRequest(),
-		resp: http_model.NewRegisterResponse(),
+		req:  http_model.NewAddSubAccountRequest(),
+		resp: http_model.NewAddSubAccountResponse(),
 		ctx:  ctx,
 	}
 }
 
 type AddNewSubAccountHandler struct {
-	req  *http_model.RegisterRequest
+	req  *http_model.AddNewSubAccountRequest
 	resp *http_model.CommonResponse
 	ctx  *gin.Context
 }
@@ -35,7 +36,28 @@ func (h *AddNewSubAccountHandler) getResponse() interface{} {
 	return h.resp
 }
 func (h *AddNewSubAccountHandler) run() {
-	fmt.Println("AddNewSubAccountHandler Running")
+	// fmt.Println("AddNewSubAccountHandler Running")
+	newSubAccount := http_model.AddNewSubAccountRequest{}
+	newSubAccount = *h.req
+	// 1. 验证码校验
+	tag, err := service.LoginAuth.SubAccountAuthCode(h.ctx, newSubAccount.PhoneNumber, newSubAccount.Code)
+	if err != nil {
+		fmt.Println(err)
+	}
+	// 2. 校验通过则创建样叽用户和子账号
+	if tag == "1" {
+		err := service.SubAccount.CreateSubAccount(h.ctx, newSubAccount)
+		if err != nil {
+			fmt.Println(err)
+			h.resp.Message = "创建失败"
+		} else {
+			h.resp.Message = "成功创建子账号"
+		}
+	} else {
+		// 验证码校验不通过的返回值
+		h.resp.Message = tag
+	}
+	return
 }
 
 func (h *AddNewSubAccountHandler) checkParam() error {

+ 4 - 4
handler/code_login.go

@@ -57,15 +57,15 @@ func (h *CodeLoginHandler) getResponse() interface{} {
 }
 
 func (h *CodeLoginHandler) run() {
-	token, err := service.LoginAuth.AuthCode(h.ctx, h.req.Phone, h.req.Code)
+	msg, userData, err := service.LoginAuth.AuthCode(h.ctx, h.req.Phone, h.req.Code)
 	if err != nil {
 		logrus.Errorf("[CodeLoginHandler] call AuthCode err:%+v\n", err)
-		util.HandlerPackErrorResp(h.resp, consts.ErrorInternal, token)
+		util.HandlerPackErrorResp(h.resp, consts.ErrorInternal, msg)
 		log.Info("login fail,req:%+v", h.req)
 		return
 	}
-	data := http_model.CodeLoginData{}
-	data.Token = token
+	var data *http_model.CodeLoginData
+	data = userData
 	// h.resp.Message = "登陆成功"
 	h.resp.Data = data
 }

+ 50 - 0
handler/deleteJob.go

@@ -0,0 +1,50 @@
+package handler
+
+import (
+	"fmt"
+	"github.com/gin-gonic/gin"
+	"youngee_b_api/model/http_model"
+	"youngee_b_api/service"
+)
+
+func WrapdeleteJobHandler(ctx *gin.Context) {
+	handler := newdeleteJobHandler(ctx)
+	baseRun(handler)
+}
+
+func newdeleteJobHandler(ctx *gin.Context) *DeleteJobHandler {
+	return &DeleteJobHandler{
+		req:  http_model.NewDeleteJobRequest(),
+		resp: http_model.NewDeleteJobResponse(),
+		ctx:  ctx,
+	}
+}
+
+type DeleteJobHandler struct {
+	req  *http_model.DeleteJobRequest
+	resp *http_model.CommonResponse
+	ctx  *gin.Context
+}
+
+func (h *DeleteJobHandler) getRequest() interface{} {
+	return h.req
+}
+func (h *DeleteJobHandler) getContext() *gin.Context {
+	return h.ctx
+}
+func (h *DeleteJobHandler) getResponse() interface{} {
+	return h.resp
+}
+func (h *DeleteJobHandler) run() {
+	jobData := http_model.DeleteJobRequest{}
+	jobData = *h.req
+	err := service.Job.DeleteJob(h.ctx, jobData)
+	if err != nil {
+		fmt.Println(err)
+	}
+	return
+}
+
+func (h *DeleteJobHandler) checkParam() error {
+	return nil
+}

+ 52 - 0
handler/find_kuaishou_product.go

@@ -0,0 +1,52 @@
+package handler
+
+import (
+	"github.com/gin-gonic/gin"
+	"github.com/sirupsen/logrus"
+	"youngee_b_api/model/http_model"
+	"youngee_b_api/service"
+)
+
+func WrapFindKuaishouProductHandler(ctx *gin.Context) {
+	handler := newFindKuaishouProductHandler(ctx)
+	baseRun(handler)
+}
+
+func newFindKuaishouProductHandler(ctx *gin.Context) *FindKuaishouProductHandler {
+	return &FindKuaishouProductHandler{
+		req:  http_model.NewFindKuaishouProductRequest(),
+		resp: http_model.NewFindKuaishouProductResponse(),
+		ctx:  ctx,
+	}
+}
+
+type FindKuaishouProductHandler struct {
+	req  *http_model.FindKuaishouProductRequest
+	resp *http_model.CommonResponse
+	ctx  *gin.Context
+}
+
+func (h *FindKuaishouProductHandler) getRequest() interface{} {
+	return h.req
+}
+func (h *FindKuaishouProductHandler) getContext() *gin.Context {
+	return h.ctx
+}
+func (h *FindKuaishouProductHandler) getResponse() interface{} {
+	return h.resp
+}
+func (h *FindKuaishouProductHandler) run() {
+	data := *&http_model.FindKuaishouProductRequest{}
+	data = *h.req
+	// print("data: ", data.ItemList)
+
+	res, err := service.Product.QueryKuaishouProduct(h.ctx, data)
+	if err != nil {
+		logrus.Info("FindKuaishouProduct fail,req:%+v", h.req)
+		return
+	}
+	h.resp.Data = res
+}
+func (h *FindKuaishouProductHandler) checkParam() error {
+	return nil
+}

+ 1 - 0
handler/send_code.go

@@ -94,6 +94,7 @@ func (h *SendCodeHandler) run() {
 		return
 	}
 	h.resp.Message = "验证码发送成功,请注意查收"
+	h.resp.Status = 200
 }
 func (h *SendCodeHandler) checkParam() error {
 	return nil

+ 50 - 0
handler/updateJob.go

@@ -0,0 +1,50 @@
+package handler
+
+import (
+	"fmt"
+	"github.com/gin-gonic/gin"
+	"youngee_b_api/model/http_model"
+	"youngee_b_api/service"
+)
+
+func WrapupdateJobHandler(ctx *gin.Context) {
+	handler := newupdateJobHandler(ctx)
+	baseRun(handler)
+}
+
+func newupdateJobHandler(ctx *gin.Context) *UpdateNewJobHandler {
+	return &UpdateNewJobHandler{
+		req:  http_model.NewUpdateJobRequest(),
+		resp: http_model.NewUpdateJobResponse(),
+		ctx:  ctx,
+	}
+}
+
+type UpdateNewJobHandler struct {
+	req  *http_model.UpdateJobRequest
+	resp *http_model.CommonResponse
+	ctx  *gin.Context
+}
+
+func (h *UpdateNewJobHandler) getRequest() interface{} {
+	return h.req
+}
+func (h *UpdateNewJobHandler) getContext() *gin.Context {
+	return h.ctx
+}
+func (h *UpdateNewJobHandler) getResponse() interface{} {
+	return h.resp
+}
+func (h *UpdateNewJobHandler) run() {
+	jobData := http_model.UpdateJobRequest{}
+	jobData = *h.req
+	err := service.Job.UpdateJob(h.ctx, jobData)
+	if err != nil {
+		fmt.Println(err)
+	}
+	return
+}
+
+func (h *UpdateNewJobHandler) checkParam() error {
+	return nil
+}

+ 8 - 8
model/gorm_model/job.go

@@ -1,14 +1,14 @@
 package gorm_model
 
 type YounggeeJob struct {
-	JobId                int    `gorm:"column:sub_account_id;primary_key;AUTO_INCREMENT"` // 子账号ID
-	JobName              string `gorm:"column:job_name"`                                  // 岗位名称
-	JobDetail            string `gorm:"column:job_detail"`                                // 岗位描述
-	WorkshopPermission   string `gorm:"column:workshop_permission"`                       // 工作台权限
-	TaskcenterPermission string `gorm:"column:taskcenter_permission"`                     // 任务中心权限
-	CoopratePermission   string `gorm:"column:cooprate_permission"`                       // 推广合作权限
-	FinancialPermission  string `gorm:"column:financial_permission"`                      // 财务结算权限
-	EnterpriseId         string `gorm:"column:enterprise_id"`                             // 岗位所属商家账号ID
+	JobId                int    `gorm:"column:job_id;primary_key;AUTO_INCREMENT"` // 岗位ID
+	JobName              string `gorm:"column:job_name"`                          // 岗位名称
+	JobDetail            string `gorm:"column:job_detail"`                        // 岗位描述
+	WorkshopPermission   string `gorm:"column:workshop_permission"`               // 工作台权限
+	TaskcenterPermission string `gorm:"column:taskcenter_permission"`             // 任务中心权限
+	CooperatePermission  string `gorm:"column:cooperate_permission"`              // 推广合作权限
+	FinancialPermission  string `gorm:"column:financial_permission"`              // 财务结算权限
+	EnterpriseId         string `gorm:"column:enterprise_id"`                     // 岗位所属商家账号ID
 }
 
 func (m *YounggeeJob) TableName() string {

+ 37 - 34
model/gorm_model/selection_info.go

@@ -1,44 +1,47 @@
 package gorm_model
 
-// Code generated by sql2gorm. DO NOT EDIT.
-
 import (
 	"time"
 )
 
 type YounggeeSelectionInfo struct {
-	SelectionID      string     `gorm:"column:selection_id;primary_key"` // 选品项目id
-	SelectionName    string     `gorm:"column:selection_name"`           // 选品项目名称
-	EnterpriseID     string     `gorm:"column:enterprise_id"`            // 所属企业id
-	ProductID        int        `gorm:"column:product_id"`               // 关联商品id
-	ContentType      int        `gorm:"column:content_type"`             // 内容形式,1代表图文,2代表视频,3代表直播
-	SelectionStatus  int        `gorm:"column:selection_status"`         // 选品项目状态,1-8分别代表创建中、待审核、审核通过、待支付、已支付、执行中、失效、已结案
-	TaskMode         int        `gorm:"column:task_mode"`                // 任务形式,1、2分别表示悬赏任务、纯佣带货
-	Platform         int        `gorm:"column:platform"`                 // 项目平台,1-7分别代表小红书、抖音、微博、快手、b站、大众点评、知乎
-	SampleMode       int        `gorm:"column:sample_mode"`              // 领样形式,1、2分别表示免费领样、垫付领样
-	ProductUrl       string     `gorm:"column:product_url"`              // 带货链接
-	SampleNum        int        `gorm:"column:sample_num"`               // 样品数量
-	RemainNum        int        `gorm:"column:remain_num"`               // 剩余数量
-	CommissionRate   float64    `gorm:"column:commission_rate"`          // 佣金比例
-	EstimatedCost    string     `gorm:"column:estimated_cost"`           // 预估成本
-	TaskReward       string     `gorm:"column:task_reward"`              // 任务悬赏
-	SampleCondition  string     `gorm:"column:sample_condition"`         // 领样条件
-	RewardCondition  string     `gorm:"column:reward_condition"`         // 返现悬赏条件
-	SettlementAmount string     `gorm:"column:settlement_amount"`        // 结算金额
-	TaskDdl          time.Time  `gorm:"column:task_ddl"`                 // 招募截止时间
-	Detail           string     `gorm:"column:detail"`                   // 卖点总结
-	ProductSnap      string     `gorm:"column:product_snap"`             // 商品信息快照
-	ProductPhotoSnap string     `gorm:"column:product_photo_snap"`       // 商品图片快照
-	CreatedAt        time.Time  `gorm:"column:created_at"`               // 创建时间
-	UpdatedAt        time.Time  `gorm:"column:updated_at"`               // 修改时间
-	SubmitAt         time.Time  `gorm:"column:submit_at"`                // 提交审核时间
-	PassAt           time.Time  `gorm:"column:pass_at"`                  // 审核通过时间
-	FailReason       int        `gorm:"column:fail_reason"`              // 失效原因,1、2分别表示逾期未支付、项目存在风险
-	PayAt            time.Time  `gorm:"column:pay_at"`                   // 支付时间
-	FinishAt         time.Time  `gorm:"column:finish_at"`                // 结案时间
-	IsRead           int        `gorm:"column:is_read"`                  // 是否已读
-	AutoTaskID       int        `gorm:"column:auto_task_id"`             // 定时任务id
-	AutoFailAt       *time.Time `gorm:"column:auto_fail_at"`             // 失效自动处理时间
+	SelectionID       string     `gorm:"column:selection_id;primary_key"` // 选品项目id
+	SelectionName     string     `gorm:"column:selection_name"`           // 选品项目名称
+	EnterpriseID      string     `gorm:"column:enterprise_id"`            // 所属企业id
+	ProductID         int        `gorm:"column:product_id"`               // 关联商品id
+	ContentType       int        `gorm:"column:content_type"`             // 内容形式,1代表图文,2代表视频,3代表直播
+	SelectionStatus   int        `gorm:"column:selection_status"`         // 选品项目状态,1-8分别代表创建中、待审核、审核通过、待支付、已支付、执行中、失效、已结案
+	TaskMode          int        `gorm:"column:task_mode"`                // 任务形式,1、2分别表示悬赏任务、纯佣带货
+	Platform          int        `gorm:"column:platform"`                 // 项目平台,1-7分别代表小红书、抖音、微博、快手、b站、大众点评、知乎
+	SampleMode        int        `gorm:"column:sample_mode"`              // 领样形式,1、2分别表示免费领样、垫付领样
+	ProductUrl        string     `gorm:"column:product_url"`              // 带货链接
+	SampleNum         int        `gorm:"column:sample_num"`               // 样品数量
+	RemainNum         int        `gorm:"column:remain_num"`               // 剩余数量
+	CommissionRate    float64    `gorm:"column:commission_rate"`          // 佣金比例
+	EstimatedCost     string     `gorm:"column:estimated_cost"`           // 预估成本
+	TaskReward        string     `gorm:"column:task_reward"`              // 任务悬赏
+	SampleCondition   string     `gorm:"column:sample_condition"`         // 领样条件
+	RewardCondition   string     `gorm:"column:reward_condition"`         // 返现悬赏条件
+	SettlementAmount  string     `gorm:"column:settlement_amount"`        // 结算金额
+	TaskDdl           time.Time  `gorm:"column:task_ddl"`                 // 招募截止时间
+	Detail            string     `gorm:"column:detail"`                   // 卖点总结
+	ProductSnap       string     `gorm:"column:product_snap"`             // 商品信息快照
+	ProductPhotoSnap  string     `gorm:"column:product_photo_snap"`       // 商品图片快照
+	CreatedAt         time.Time  `gorm:"column:created_at"`               // 创建时间
+	UpdatedAt         time.Time  `gorm:"column:updated_at"`               // 修改时间
+	SubmitAt          time.Time  `gorm:"column:submit_at"`                // 提交审核时间
+	PassAt            time.Time  `gorm:"column:pass_at"`                  // 审核通过时间
+	FailReason        int        `gorm:"column:fail_reason"`              // 失效原因,1、2分别表示逾期未支付、项目存在风险
+	PayAt             time.Time  `gorm:"column:pay_at"`                   // 支付时间
+	FinishAt          time.Time  `gorm:"column:finish_at"`                // 结案时间
+	IsRead            int        `gorm:"column:is_read"`                  // 是否已读
+	AutoTaskID        int        `gorm:"column:auto_task_id"`             // 定时任务id
+	AutoFailAt        *time.Time `gorm:"column:auto_fail_at"`             // 失效自动处理时间
+	EnrollNum         int        `gorm:"column:enroll_num"`               // 报名数量
+	ChooseNum         int        `gorm:"column:choose_num"`               // 已选数量
+	BeforeDeliveryNum int        `gorm:"column:before_delivery_num"`      // 待发货数量
+	DeliveryNum       int        `gorm:"column:delivery_num"`             // 已发货数量
+	AfterDeliveryNum  int        `gorm:"column:after_delivery_num"`       // 已收货数量
 }
 
 func (m *YounggeeSelectionInfo) TableName() string {

+ 39 - 32
model/gorm_model/selection_task_info.go

@@ -1,42 +1,49 @@
 package gorm_model
 
-// Code generated by sql2gorm. DO NOT EDIT.
-
 import (
 	"time"
 )
 
 type YounggeeSecTaskInfo struct {
-	ID                     int       `gorm:"column:id;primary_key"`                        // 递增id
-	TaskID                 string    `gorm:"column:task_id"`                               // 选品任务id
-	SelectionID            string    `gorm:"column:selection_id"`                          // 选品id
-	TalentID               string    `gorm:"column:talent_id"`                             // 达人id
-	AccountID              int       `gorm:"column:account_id"`                            // 账号id
-	TalentPlatformInfoSnap string    `gorm:"column:talent_platform_info_snap"`             // 达人平台信息快照
-	TalentPersonalInfoSnap string    `gorm:"column:talent_personal_info_snap"`             // 达人个人信息快照
-	TalentPostAddrSnap     string    `gorm:"column:talent_post_addr_snap"`                 // 收货地址快照
-	TaskReward             string    `gorm:"column:task_reward"`                           //  达人赏金
-	TalentPayment          string    `gorm:"column:talent_payment"`                        // 达人垫付金额
-	IsPayPayment           int       `gorm:"column:is_pay_payment"`                        // 企业是否返样品钱
-	IsPayReward            int       `gorm:"column:is_pay_reward"`                         // 企业是否结算悬赏
-	TaskMode               int       `gorm:"column:task_mode"`                             // 任务形式,1、2分别表示纯佣带货、悬赏任务
-	SampleMode             int       `gorm:"column:sample_mode"`                           // 领样形式,1-3分别表示免费领样、垫付买样、不提供样品
-	TaskStatus             int       `gorm:"column:task_status;default:1"`                 // 任务状态 1待选 2已选 3落选
-	TaskStage              int       `gorm:"column:task_stage"`                            // 任务阶段,详情见info_sec_task_stage表
-	CreateDate             time.Time `gorm:"column:create_date"` // 创建时间
-	SelectDate             time.Time `gorm:"column:select_date"`                           // 反选时间
-	DeliveryDate           time.Time `gorm:"column:delivery_date"`                         // 发货时间
-	CompleteDate           time.Time `gorm:"column:complete_date"`                         // 结束时间
-	WithdrawDate           time.Time `gorm:"column:withdraw_date"`                         // 提现时间
-	CompleteStatus         int       `gorm:"column:complete_status;default:1"`             // 结束方式 1未结束 2正常结束 3反选失败
-	LogisticsStatus        int       `gorm:"column:logistics_status;default:1"`            // 发货状态 1 待发货 2已发货 3 已签收
-	AssignmentStatus       uint      `gorm:"column:assignment_status;default:1"`           // 作业上传状态 1-5分别代表待添加、已添加、待修改、已修改、已通过
-	UpdateAt               time.Time `gorm:"column:update_at"`                             // 更新时间
-	WithdrawStatus         int       `gorm:"column:withdraw_status;default:1"`             // 提现状态,1-4分别代表不可提现、可提现、提现中、已提现
-	LeadTeamID             string    `gorm:"column:lead_team_id"`                          // 作为团长的young之团id,对应younggee_talent_team中的team_id字段
-	TeamID                 string    `gorm:"column:team_id"`                               // 作为团员的young之团id,对应younggee_talent_team中的team_id字段
-	TeamIncome             int       `gorm:"column:team_income"`                           // young之团团长现金收益
-	TeamPoint              int       `gorm:"column:team_point"`                            // young之团团长积分收益
+	ID                     int       `gorm:"column:id;primary_key"`              // 递增id
+	TaskID                 string    `gorm:"column:task_id"`                     // 选品任务id
+	SelectionID            string    `gorm:"column:selection_id"`                // 选品id
+	TalentID               string    `gorm:"column:talent_id"`                   // 达人id
+	AccountID              int       `gorm:"column:account_id"`                  // 账号id
+	TalentPlatformInfoSnap string    `gorm:"column:talent_platform_info_snap"`   // 达人平台信息快照
+	TalentPersonalInfoSnap string    `gorm:"column:talent_personal_info_snap"`   // 达人个人信息快照
+	TalentPostAddrSnap     string    `gorm:"column:talent_post_addr_snap"`       // 收货地址快照
+	TaskReward             string    `gorm:"column:task_reward"`                 //  达人赏金
+	TalentPayment          string    `gorm:"column:talent_payment"`              // 达人垫付金额
+	IsPayPayment           int       `gorm:"column:is_pay_payment"`              // 企业是否返样品钱
+	IsPayReward            int       `gorm:"column:is_pay_reward"`               // 企业是否结算悬赏
+	TaskMode               int       `gorm:"column:task_mode"`                   // 任务形式,1、2分别表示纯佣带货、悬赏任务
+	SampleMode             int       `gorm:"column:sample_mode"`                 // 领样形式,1-3分别表示免费领样、垫付买样、不提供样品
+	TaskStatus             int       `gorm:"column:task_status;default:1"`       // 任务状态 1待选 2已选 3落选
+	TaskStage              int       `gorm:"column:task_stage"`                  // 任务阶段,详情见info_sec_task_stage表
+	CreateDate             time.Time `gorm:"column:create_date"`                 // 创建时间
+	SelectDate             time.Time `gorm:"column:select_date"`                 // 反选时间
+	DeliveryDate           time.Time `gorm:"column:delivery_date"`               // 发货时间
+	CompleteDate           time.Time `gorm:"column:complete_date"`               // 结束时间
+	WithdrawDate           time.Time `gorm:"column:withdraw_date"`               // 提现时间
+	CompleteStatus         int       `gorm:"column:complete_status;default:1"`   // 结束方式 1未结束 2正常结束 3反选失败
+	LogisticsStatus        int       `gorm:"column:logistics_status;default:1"`  // 发货状态 1 待发货 2已发货 3 已签收
+	AssignmentStatus       uint      `gorm:"column:assignment_status;default:1"` // 作业上传状态 1-5分别代表待添加、已添加、待修改、已修改、已通过
+	UpdateAt               time.Time `gorm:"column:update_at"`                   // 更新时间
+	WithdrawStatus         int       `gorm:"column:withdraw_status;default:1"`   // 提现状态,1-4分别代表不可提现、可提现、提现中、已提现
+	LeadTeamID             string    `gorm:"column:lead_team_id"`                // 作为团长的young之团id,对应younggee_talent_team中的team_id字段
+	TeamID                 string    `gorm:"column:team_id"`                     // 作为团员的young之团id,对应younggee_talent_team中的team_id字段
+	TeamIncome             int       `gorm:"column:team_income"`                 // young之团团长现金收益
+	TeamPoint              int       `gorm:"column:team_point"`                  // young之团团长积分收益
+	SignedTime             time.Time `gorm:"column:signed_time"`                 // 快递签收时间
+	SaleNum                int       `gorm:"column:sale_num"`                    // 30天橱窗销量
+	FreeStrategyId         int       `gorm:"column:free_strategy_id"`            // 免费领样策略id
+	ProductId              int       `gorm:"column:product_id"`                  // 商品id
+	SaleActual             int       `gorm:"column:sale_actual"`                 // 实际带货量
+	SaleNumAll             int       `gorm:"column:sale_num_all"`                // 达人对此商品的全部销售量(大于1表示已出单)
+	FansNum                int       `gorm:"column:fans_num"`                    // 粉丝数
+	FreeStage              int       `gorm:"column:free_stage"`                  // 免费领样阶段,1-5分别代表已申请、已拒绝、待发货、已发货、已收货
+	RewardStage            int       `gorm:"column:reward_stage"`                // 悬赏阶段,1-2分别代表待结算(管理后台设置)、已结算(小程序端设置)
 }
 
 func (m *YounggeeSecTaskInfo) TableName() string {

+ 16 - 0
model/gorm_model/sub_account.go

@@ -0,0 +1,16 @@
+package gorm_model
+
+type YounggeeSubAccount struct {
+	SubAccountId   int    `gorm:"column:sub_account_id;primary_key;AUTO_INCREMENT"` // 子账号ID
+	PhoneNumber    string `gorm:"column:phone_number"`                              // 手机号
+	SubAccountName string `gorm:"column:sub_account_name"`                          // 子账号名称
+	JobId          int    `gorm:"column:job_id"`                                    // 岗位ID
+	EnterpriseId   string `gorm:"column:enterprise_id"`                             // 所属商家账号ID
+	AccountStatus  int    `gorm:"column:account_status"`                            // 账号状态,1为正常,2为停用
+	UserId         int    `gorm:"column:user_id"`                                   // 用户表中ID
+	SubAccountType int    `gorm:"column:sub_account_type"`                          // 子账号类型,1为商家端子账号,2为管理后台子账号
+}
+
+func (m *YounggeeSubAccount) TableName() string {
+	return "younggee_sub_account"
+}

+ 2 - 3
model/gorm_model/user.go

@@ -1,4 +1,3 @@
-// Code generated by sql2gorm. DO NOT EDIT.
 package gorm_model
 
 import (
@@ -6,7 +5,7 @@ import (
 )
 
 type YounggeeUser struct {
-	ID            int64       `gorm:"column:id;primary_key;AUTO_INCREMENT"` // 用户表id
+	ID            int64     `gorm:"column:id;primary_key;AUTO_INCREMENT"` // 用户表id
 	User          string    `gorm:"column:user"`                          // 账号
 	Username      string    `gorm:"column:username"`                      // 后台用户名
 	Password      string    `gorm:"column:password"`                      // 用户密码
@@ -18,9 +17,9 @@ type YounggeeUser struct {
 	UserState     string    `gorm:"column:user_state;default:1;NOT NULL"` // 0,禁用,1,正常
 	CreatedAt     time.Time `gorm:"column:created_at"`                    // 创建时间
 	UpdatedAt     time.Time `gorm:"column:updated_at"`                    // 更新时间
+	AuthStatus    int       `gorm:"column:auth_status"`                   // 认证状态
 }
 
 func (m *YounggeeUser) TableName() string {
 	return "younggee_user"
 }
-

+ 16 - 6
model/http_model/GetSecTaskList.go

@@ -9,6 +9,9 @@ type GetSecTaskListRequest struct {
 	SecTaskStatus int    `json:"sec_task_status"`
 	SearchValue   string `json:"search_value"`
 	Type          int    `json:"type"` // 查询类型,1、2、3分别表示确定达人查询、发货管理查询、结算管理查询
+	TaskStage     int    `json:"sec_task_stage"`
+	FreeStage     int    `json:"free_stage"`   // 免费领样阶段,1-5分别代表已申请、已拒绝、待发货、已发货、已收货
+	RewardStage   int    `json:"reward_stage"` // 悬赏阶段,1-2分别代表待结算(管理后台设置)、已结算(小程序端设置)
 }
 
 type GetSecTaskListData struct {
@@ -17,12 +20,13 @@ type GetSecTaskListData struct {
 }
 
 type SecTaskInfo struct {
-	SecTaskId             string    `json:"sec_task_id"`
-	PlatformNickname      string    `json:"platform_nickname"`     // 帐号昵称
-	FansCount             string    `json:"fans_count"`            // 粉丝数
-	HomePageCaptureUrl    string    `json:"home_page_capture_url"` // 主页截图链接
-	HomePageUrl           string    `json:"home_page_url"`         // 主页链接
-	RegionCode            int       `json:"region_code"`
+	SecTaskId             string    `json:"sec_task_id"`            // 带货任务ID
+	PlatformNickname      string    `json:"platform_nickname"`      // 帐号昵称
+	TalentId              string    `json:"talent_id"`              // 达人ID
+	FansCount             string    `json:"fans_count"`             // 粉丝数
+	HomePageCaptureUrl    string    `json:"home_page_capture_url"`  // 主页截图链接
+	HomePageUrl           string    `json:"home_page_url"`          // 主页链接
+	RegionCode            int       `json:"region_code"`            // 区域编码
 	DetailAddr            string    `json:"detail_addr"`            // 物流信息
 	CompanyName           string    `json:"company_name"`           // 物流公司
 	LogisticsNumber       string    `json:"logistics_number"`       // 物流单号
@@ -39,6 +43,12 @@ type SecTaskInfo struct {
 	SelectDate            string    `json:"select_date"`            // 反选时间
 	DeliveryDate          string    `json:"delivery_date"`          // 发货时间
 	CompleteDate          string    `json:"complete_date"`          // 结算时间
+	SignedTime            string    `json:"signed_time"`            // 快递签收时间
+	SaleNum               int       `json:"sale_num"`               // 30天橱窗销量
+	FreeStrategyId        int       `json:"free_strategy_id"`       // 免费领样策略id
+	ProductId             int       `json:"product_id"`             // 商品ID
+	FreeStage             int       `json:"free_stage"`             // 免费领样阶段,1-5分别代表已申请、已拒绝、待发货、已发货、已收货
+	RewardStage           int       `json:"reward_stage"`           // 悬赏阶段,1-2分别代表待结算(管理后台设置)、已结算(小程序端设置)
 }
 
 func NewGetSecTaskListRequest() *GetSecTaskListRequest {

+ 23 - 0
model/http_model/addNewJob.go

@@ -0,0 +1,23 @@
+package http_model
+
+type AddNewJobRequest struct {
+	EnterpriseId         string `json:"enterprise_id"`         // 企业ID
+	JobName              string `json:"job_name"`              // 岗位名称
+	JobDetail            string `json:"job_detail"`            // 企业描述
+	WorkshopPermission   string `json:"workshop_permission"`   // 工作台权限
+	TaskcenterPermission string `json:"taskcenter_permission"` // 任务中心权限
+	CooperatePermission  string `json:"cooperate_permission"`  // 推广合作中心权限
+	FinancialPermission  string `json:"financial_permission"`  // 财务结算权限
+}
+
+type AddNewJobData struct {
+}
+
+func NewAddNewJobRequest() *AddNewJobRequest {
+	return new(AddNewJobRequest)
+}
+func NewAddNewJobResponse() *CommonResponse {
+	resp := new(CommonResponse)
+	resp.Data = new(AddNewJobData)
+	return resp
+}

+ 25 - 0
model/http_model/addNewSubAccount.go

@@ -0,0 +1,25 @@
+package http_model
+
+type AddNewSubAccountRequest struct {
+	EnterpriseId   string `json:"enterprise_id"`    // 子账号属于的企业id
+	PhoneNumber    string `json:"phone_number"`     // 手机号
+	SubAccountName string `json:"sub_account_name"` // 子账号名称
+	JobId          int    `json:"job_id"`           // 岗位ID
+	Code           string `json:"code"`             // 验证码
+}
+
+type AddNewSubAccountData struct {
+	UserID       int64  `json:"user_id"`          // 用户id
+	EnterpriseId string `json:"enterprise_id"`    // 企业id
+	SubAccountID string `json:"sub_account_name"` // 子账号id
+}
+
+func NewAddSubAccountRequest() *AddNewSubAccountRequest {
+	return new(AddNewSubAccountRequest)
+}
+
+func NewAddSubAccountResponse() *CommonResponse {
+	resp := new(CommonResponse)
+	resp.Data = new(AddNewSubAccountData)
+	return resp
+}

+ 10 - 1
model/http_model/code_login.go

@@ -6,7 +6,16 @@ type CodeLoginRequest struct {
 }
 
 type CodeLoginData struct {
-	Token string `json:"token"`
+	Token                string `json:"token"`                 // Token
+	Role                 string `json:"role"`                  // 角色 1,超级管理员; 2,管理员;3,企业用户; 4. 企业子账号;5. 管理后台子账号
+	JobName              string `json:"job_name"`              // 岗位名称
+	UserId               int64  `json:"user_id"`               // YG用户ID
+	EnterpriseId         string `json:"enterprise_id"`         // 商家ID
+	SubAccountId         int    `json:"sub_account_id"`        // 子账号ID
+	WorkshopPermission   string `json:"workshop_permission"`   // 工作台权限
+	TaskcenterPermission string `json:"taskcenter_permission"` // 任务中心权限
+	CooperatePermission  string `json:"cooperate_permission"`  // 推广合作权限
+	FinancialPermission  string `json:"financial_Permission"`  // 财务结算权限
 }
 
 func NewCodeLoginRequest() *CodeLoginRequest {

+ 18 - 0
model/http_model/deleteJob.go

@@ -0,0 +1,18 @@
+package http_model
+
+type DeleteJobRequest struct {
+	JobId int `json:"job_id"` // 岗位ID
+}
+
+type DeleteJobData struct {
+}
+
+func NewDeleteJobRequest() *DeleteJobRequest {
+	return new(DeleteJobRequest)
+}
+
+func NewDeleteJobResponse() *CommonResponse {
+	resp := new(CommonResponse)
+	resp.Data = new(DeleteJobData)
+	return resp
+}

+ 42 - 0
model/http_model/find_kuaishou_product.go

@@ -0,0 +1,42 @@
+package http_model
+
+type FindKuaishouProductRequest struct {
+	AppKey      string   `json:"app_key"`
+	SignSecret  string   `json:"sign_secret"`
+	AccessToken string   `json:"access_token"`
+	ItemList    []string `json:"item_list"`
+}
+
+type KuaishouCarousePhoto struct {
+	PhotoUrl string `json:"photo_url"` // 图片或视频url
+}
+
+type KuaishouDetailPhoto struct {
+	PhotoUrl string `json:"photo_url"` // 图片或视频url
+}
+
+type FindKuaishouProductData struct {
+	ProductName                 string   `json:"product_name"`                    // 商品名称
+	ProductPrice                float64  `json:"product_price"`                   // 商品价值
+	ProductDetail               string   `json:"product_detail"`                  // 商品描述
+	KuaishouMainPhoto           string   `json:"kuaishou_main_photo"`             // 商品主图
+	KuaishouCarousePhotoList    []string `json:"kuaishou_carouse_photo_list"`     // 商品轮播图列表
+	KuaishouDetailPhotoList     []string `json:"kuaishou_detail_photo_list"`      // 商品详情图列表
+	ProductUrl                  string   `json:"product_url"`                     // 商品链接,可为电商网址、公司官网、大众点评的店铺地址等可以说明商品信息或者品牌信息的线上地址;
+	EnterpriseID                string   `json:"enterprise_id"`                   // 所属企业id
+	BrandName                   string   `json:"brand_name"`                      // 品牌名称
+	PublicCommission            float64  `json:"public_commission"`               // 公开佣金
+	ExclusiveCommission         float64  `json:"exclusive_commission"`            // 专属佣金
+	CommissionPrice             float64  `json:"commission_price"`                // 佣金金额
+	KuaishouProductId           int64    `json:"kuaishou_product_id"`             // 快手商品ID
+	MerchantSoldCountThirtyDays int64    `json:"merchant_sold_count_thirty_days"` // 商品30天销量
+}
+
+func NewFindKuaishouProductRequest() *FindKuaishouProductRequest {
+	return new(FindKuaishouProductRequest)
+}
+func NewFindKuaishouProductResponse() *CommonResponse {
+	resp := new(CommonResponse)
+	resp.Data = new(FindKuaishouProductData)
+	return resp
+}

+ 25 - 0
model/http_model/updateJob.go

@@ -0,0 +1,25 @@
+package http_model
+
+type UpdateJobRequest struct {
+	JobId                int    `json:"job_id"`                // 岗位ID
+	EnterpriseId         string `json:"enterprise_id"`         // 企业ID
+	JobName              string `json:"job_name"`              // 岗位名称
+	JobDetail            string `json:"job_detail"`            // 企业描述
+	WorkshopPermission   string `json:"workshop_permission"`   // 工作台权限
+	TaskcenterPermission string `json:"taskcenter_permission"` // 任务中心权限
+	CooperatePermission  string `json:"cooperate_permission"`  // 推广合作中心权限
+	FinancialPermission  string `json:"financial_permission"`  // 财务结算权限
+}
+
+type UpdateJobData struct {
+}
+
+func NewUpdateJobRequest() *UpdateJobRequest {
+	return new(UpdateJobRequest)
+}
+
+func NewUpdateJobResponse() *CommonResponse {
+	resp := new(CommonResponse)
+	resp.Data = new(UpdateJobData)
+	return resp
+}

+ 1 - 1
model/redis_model/auth.go

@@ -1,6 +1,6 @@
 package redis_model
 
-// redis 存放的企业用户信息Session
+// Auth redis 存放的企业用户信息Session
 type Auth struct {
 	Phone        string `json:"phone"`
 	ID           int64  `json:"id"`        // 用户表id

+ 13 - 0
model/redis_model/subAccountAuth.go

@@ -0,0 +1,13 @@
+package redis_model
+
+// SubAccountAuth redis 存放的企业子账号用户信息Session
+type SubAccountAuth struct {
+	Phone          string `json:"phone"`            // 电话号码
+	ID             int64  `json:"id"`               // 用户表id
+	User           string `json:"user"`             // 账号
+	Username       string `json:"username"`         // 后台用户名
+	SubAccountName string `json:"sub_account_name"` // 子账号名称
+	Role           string `json:"role"`             // 角色 1,超级管理员; 2,管理员;3,企业用户; 4. 企业子账号;5. 管理后台子账号
+	Token          string `json:"token"`            // Token
+	EnterpriseID   string `json:"enterprise_id"`    // 企业ID
+}

+ 5 - 0
pack/sec_task_list.go

@@ -35,5 +35,10 @@ func GormSecTaskToHttpSecTask(secTask *gorm_model.YounggeeSecTaskInfo) *http_mod
 		CompleteDate:       conv.MustString(secTask.CompleteDate, ""),
 		IsPayReward:        secTask.IsPayReward,
 		IsPayPayment:       secTask.IsPayPayment,
+		SignedTime:         conv.MustString(secTask.SignedTime, "0000"),
+		SaleNum:            secTask.SaleNum,
+		FreeStrategyId:     secTask.FreeStrategyId,
+		TalentId:           secTask.TalentID,
+		ProductId:          secTask.ProductId,
 	}
 }

+ 16 - 18
route/init.go

@@ -1,27 +1,25 @@
 package route
 
 import (
-	"youngee_b_api/app/controller"
-	"youngee_b_api/handler"
-	"youngee_b_api/middleware"
-	"youngee_b_api/model/http_model"
-
 	"github.com/gin-gonic/gin"
 	"github.com/sirupsen/logrus"
 	swaggerFiles "github.com/swaggo/files"
 	ginSwagger "github.com/swaggo/gin-swagger"
+	"youngee_b_api/app/controller"
+	"youngee_b_api/handler"
+	"youngee_b_api/middleware"
+	"youngee_b_api/model/http_model"
 )
 
 func InitRoute(r *gin.Engine) {
 	r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
-	// 商家主账号注册
-	r.POST("/register", handler.WrapRegisterHandler)
-	// 商家子账号注册
-	r.POST("/addNewSubAccount", handler.WrapAddNewSubAccountHandler)
-	// 发送登录验证码
-	r.POST("/sendCode", handler.WrapSendCodeHandler)
-	// 商家登录
-	r.POST("/login", handler.WrapCodeLoginHandler)
+	r.POST("/register", handler.WrapRegisterHandler)                 // 商家主账号注册
+	r.POST("/addNewSubAccount", handler.WrapAddNewSubAccountHandler) // 商家子账号注册
+	r.POST("/addNewJob", handler.WrapaddNewJobHandler)               // 商家新增岗位
+	r.POST("/updateJob", handler.WrapupdateJobHandler)               // 商家修改岗位
+	r.POST("/deleteJob", handler.WrapdeleteJobHandler)               // 商家删除岗位
+	r.POST("/sendCode", handler.WrapSendCodeHandler)                 // 发送登录验证码
+	r.POST("/login", handler.WrapCodeLoginHandler)                   // 商家登录
 	r.GET("/test/ping", func(c *gin.Context) {
 		resp := http_model.CommonResponse{
 			Status:  0,
@@ -48,7 +46,8 @@ func InitRoute(r *gin.Engine) {
 			auth := middleware.GetSessionAuth(c)
 			logrus.Infof("auth:%+v", auth)
 		})
-		m.POST("/product/findall", handler.WrapFindAllProductHandler)                        //查询全部产品
+		m.POST("/product/findKuaishou", handler.WrapFindKuaishouProductHandler)              // 查询快手产品信息
+		m.POST("/product/findall", handler.WrapFindAllProductHandler)                        // 查询全部产品
 		m.POST("/product/find", handler.WrapFindProductHandler)                              // 查找单个产品
 		m.POST("/project/create", handler.WrapCreateProjectHandler)                          // 创建项目
 		m.POST("/project/show", handler.WrapShowProjectHandler)                              // 展示项目内容
@@ -145,9 +144,9 @@ func InitRoute(r *gin.Engine) {
 	s := r.Group("/youngee/s")
 	{
 		s.Use(middleware.LoginAuthMiddleware)
-		s.POST("/selection/delete", handler.WrapDeleteSelectionHandler)                       //删除选品
-		s.POST("/selection/findAll", handler.WrapFindAllSelectionHandler)                     //选品列表
-		s.POST("/selection/detail", handler.WrapSelectionDetailHandler)                       //选品详情
+		s.POST("/selection/delete", handler.WrapDeleteSelectionHandler)                       // 删除选品
+		s.POST("/selection/findAll", handler.WrapFindAllSelectionHandler)                     // 选品列表
+		s.POST("/selection/detail", handler.WrapSelectionDetailHandler)                       // 选品详情
 		s.POST("/selection/create", handler.WrapCreateSelectionHandler)                       // 创建选品
 		s.POST("/selection/update", handler.WrapUpdateSelectionHandler)                       // 更新选品
 		s.POST("/selection/pay", handler.WrapPaySelectionHandler)                             // 支付选品项目
@@ -191,5 +190,4 @@ func InitRoute(r *gin.Engine) {
 		task.POST("/draft/project/list", controller.TaskController{}.GetProjectDraftList)     // 草稿箱——品牌种草列表
 
 	}
-
 }

+ 18 - 16
service/autoTask.go

@@ -9,22 +9,24 @@ import (
 
 func AutoTask() error {
 	c := cron.New(cron.WithSeconds())
-	//spec := "0 * */10 * * ?" //cron表达式,每半小时执行一次
-	//_, err1 := c.AddFunc(spec, 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
-	//}
-	//_, err3 := c.AddFunc(spec, AutoTaskCompleteSelection)
-	//if err3 != nil {
-	//	log.Println("service [AutoTaskCompleteSecTask] error:", err2)
-	//	return err3
-	//}
+	spec := "0 */30 * * * ?" //cron表达式,每半小时执行一次
+	//spec := "0 */1 * * * ?" //cron表达式,每1分钟一次
+	//spec := "*/10 * * * * ?" //cron表达式,每10秒一次
+	_, err1 := c.AddFunc(spec, 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
+	}
+	_, err3 := c.AddFunc(spec, AutoTaskCompleteSelection)
+	if err3 != nil {
+		log.Println("service [AutoTaskCompleteSecTask] error:", err2)
+		return err3
+	}
 	c.Start()
 	return nil
 }

+ 62 - 0
service/job.go

@@ -0,0 +1,62 @@
+package service
+
+import (
+	"context"
+	"youngee_b_api/db"
+	"youngee_b_api/model/gorm_model"
+	"youngee_b_api/model/http_model"
+)
+
+var Job *job
+
+type job struct {
+}
+
+// CreateJob 新增岗位
+func (*job) CreateJob(ctx context.Context, request http_model.AddNewJobRequest) error {
+	var newJob = gorm_model.YounggeeJob{
+		JobDetail:            request.JobDetail,
+		JobName:              request.JobName,
+		WorkshopPermission:   request.WorkshopPermission,
+		TaskcenterPermission: request.TaskcenterPermission,
+		CooperatePermission:  request.CooperatePermission,
+		FinancialPermission:  request.FinancialPermission,
+		EnterpriseId:         request.EnterpriseId,
+	}
+	err := db.CreateJob(ctx, newJob)
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+// UpdateJob 修改岗位
+func (*job) UpdateJob(ctx context.Context, request http_model.UpdateJobRequest) error {
+	var newJob = gorm_model.YounggeeJob{
+		JobId:                request.JobId,
+		JobDetail:            request.JobDetail,
+		JobName:              request.JobName,
+		WorkshopPermission:   request.WorkshopPermission,
+		TaskcenterPermission: request.TaskcenterPermission,
+		CooperatePermission:  request.CooperatePermission,
+		FinancialPermission:  request.FinancialPermission,
+		EnterpriseId:         request.EnterpriseId,
+	}
+	err := db.UpdateJob(ctx, newJob)
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+// DeleteJob 删除岗位
+func (*job) DeleteJob(ctx context.Context, request http_model.DeleteJobRequest) error {
+	var newJob = gorm_model.YounggeeJob{
+		JobId: request.JobId,
+	}
+	err := db.DeleteJob(ctx, newJob)
+	if err != nil {
+		return err
+	}
+	return nil
+}

+ 179 - 40
service/login_auth.go

@@ -10,6 +10,8 @@ import (
 	"time"
 	"youngee_b_api/consts"
 	"youngee_b_api/db"
+	"youngee_b_api/model/gorm_model"
+	"youngee_b_api/model/http_model"
 	"youngee_b_api/model/redis_model"
 	"youngee_b_api/model/system_model"
 	"youngee_b_api/redis"
@@ -49,58 +51,142 @@ func (l *loginAuth) AuthToken(ctx context.Context, token string) (*redis_model.A
 }
 
 // AuthCode 判断此手机号是否有账号存在 鉴定验证码 用户信息存入redis 并返回Token
-func (l *loginAuth) AuthCode(ctx context.Context, phone string, code string) (string, error) {
-	user, err := db.GetUserByPhone(ctx, phone)
-	fmt.Println("login_auth", user, err)
-	if err != nil {
-		return "", err
-	} else if user == nil {
-		// 账号不存在,则注册账号
-		_, err = Enterprise.CreateEnterprise(ctx, phone)
-		if err != nil {
-			return "账号创建失败", err
-		}
-		user, err = db.GetUserByPhone(ctx, phone)
-		fmt.Println("login_auth", user, err)
-		if err != nil {
-			return "", err
-		}
-	} else if string(user.Role) != consts.BRole {
-		// 账号权限有误
-		logrus.Debugf("[AuthCode] auth fail,phone:%+v", phone)
-		return "权限错误,请登录企业账号", errors.New("auth fail")
-	}
+func (l *loginAuth) AuthCode(ctx context.Context, phone string, code string) (string, *http_model.CodeLoginData, error) {
+
+	// 1. 验证码校验
 	vcode, err := l.getSessionCode(ctx, phone)
 	if err != nil {
-		return "", err
+		return "", nil, err
 	}
 	fmt.Printf("缓存的验证码 vcode: %v,实际填入的 code:%v", vcode, code)
 	if vcode != code {
 		// 验证码错误
 		logrus.Debugf("[AuthCode] auth fail,phone:%+v", phone)
-		return "验证码有误", errors.New("auth fail")
+		return "验证码有误", nil, errors.New("auth fail")
 	}
-	token := l.getToken(ctx, phone)
-	enterprise, err := db.GetEnterpriseByUID(ctx, user.ID)
+
+	// 2. 查询是否存在用户信息,存在则取出,不存在则注册并取出
+	var userData *gorm_model.YounggeeUser
+	user, err := db.GetUserByPhone(ctx, phone)
+	fmt.Println("login_auth", user, err)
 	if err != nil {
-		return "", err
+		// 数据库操作错误
+		return "", nil, err
+	} else if user == nil {
+		user, err := db.GetSubUserByPhone(ctx, phone)
+
+		fmt.Println("子账号存在")
+		if user == nil {
+			fmt.Println("子账号也不存在")
+			// 账号不存在,则默认注册商家账号
+			_, err = Enterprise.CreateEnterprise(ctx, phone)
+			if err != nil {
+				return "账号创建失败", nil, err
+			}
+			user, err = db.GetUserByPhone(ctx, phone)
+			userData = user
+			fmt.Println("login_auth", user, err)
+			if err != nil {
+				return "", nil, err
+			}
+		} else {
+			userData = user
+		}
+	} else if user != nil {
+		userData = user
 	}
-	auth := &redis_model.Auth{
-		Phone:        phone,
-		ID:           user.ID,
-		User:         user.User,
-		Username:     user.Username,
-		RealName:     user.RealName,
-		Role:         user.Role,
-		Email:        user.Email,
-		Token:        token,
-		EnterpriseID: enterprise.EnterpriseID,
+
+	token := l.getToken(ctx, phone)
+	var jobData gorm_model.YounggeeJob
+	var accountData gorm_model.YounggeeSubAccount
+	var enterpriseUser gorm_model.Enterprise
+	var loginUserData http_model.CodeLoginData
+	var ifEnterprise int = 0
+	var ifSubAccount int = 0
+
+	// 3. 根据用户类型的不同补充信息
+	// 若为商家用户
+	if string(userData.Role) == consts.BRole {
+		ifEnterprise = 1
+		fmt.Println("商家主账号")
+		enterprise, err := db.GetEnterpriseByUID(ctx, userData.ID)
+		enterpriseUser = *enterprise
+		if err != nil {
+			return "", nil, err
+		}
+		auth := &redis_model.Auth{
+			Phone:        phone,
+			ID:           userData.ID,
+			User:         userData.User,
+			Username:     userData.Username,
+			RealName:     userData.RealName,
+			Role:         userData.Role,
+			Email:        userData.Email,
+			Token:        token,
+			EnterpriseID: enterprise.EnterpriseID,
+		}
+		if err := l.setSession(ctx, phone, auth); err != nil {
+			fmt.Printf("setSession error\n")
+			return "", nil, err
+		}
+	} else {
+		// 若为商家子账号
+		ifSubAccount = 1
+		fmt.Printf("商家子账号")
+		subaccount, err := db.FindSubAccountByPhone(ctx, phone)
+		accountData = *subaccount
+		if err != nil {
+			return "", nil, err
+		}
+		auth := &redis_model.Auth{
+			Phone:        phone,
+			ID:           userData.ID,
+			User:         userData.User,
+			Username:     userData.Username,
+			RealName:     userData.RealName,
+			Role:         userData.Role,
+			Email:        userData.Email,
+			Token:        token,
+			EnterpriseID: subaccount.EnterpriseId,
+		}
+
+		job, err := db.FindJobByJobId(ctx, subaccount.JobId)
+		jobData = *job
+		if err := l.setSession(ctx, phone, auth); err != nil {
+			fmt.Printf("setSession error\n")
+			return "", nil, err
+		}
 	}
-	if err := l.setSession(ctx, phone, auth); err != nil {
-		fmt.Printf("setSession error\n")
-		return "", err
+
+	if ifEnterprise == 1 {
+		loginUserData = http_model.CodeLoginData{
+			UserId:               userData.ID,
+			Token:                token,
+			Role:                 userData.Role,
+			SubAccountId:         -1,
+			JobName:              "-1",
+			EnterpriseId:         enterpriseUser.EnterpriseID,
+			WorkshopPermission:   "-1",
+			CooperatePermission:  "-1",
+			FinancialPermission:  "-1",
+			TaskcenterPermission: "-1",
+		}
+	} else if ifSubAccount == 1 {
+		loginUserData = http_model.CodeLoginData{
+			UserId:               userData.ID,
+			Token:                token,
+			Role:                 userData.Role,
+			SubAccountId:         accountData.SubAccountId,
+			JobName:              jobData.JobName,
+			EnterpriseId:         accountData.EnterpriseId,
+			WorkshopPermission:   jobData.WorkshopPermission,
+			CooperatePermission:  jobData.CooperatePermission,
+			FinancialPermission:  jobData.FinancialPermission,
+			TaskcenterPermission: jobData.TaskcenterPermission,
+		}
 	}
-	return token, nil
+
+	return "", &loginUserData, nil
 }
 
 // func (l *loginAuth) AuthPassword(ctx context.Context, phone string, password string) (string, error) {
@@ -193,3 +279,56 @@ func (l *loginAuth) encryptPassword(password string) string {
 func (l *loginAuth) getRedisKey(key string) string {
 	return fmt.Sprintf("%s%s", consts.SessionRedisPrefix, key)
 }
+
+func (l *loginAuth) SubAccountAuthCode(ctx context.Context, phone string, code string) (string, error) {
+	user, err := db.FindSubAccountByPhone(ctx, phone)
+	phoneNumber := phone
+	fmt.Println("login_auth", user, err)
+	if err != nil {
+		// 数据库错误
+		return "数据库错误", err
+	} else if user == nil {
+		// 账号不存在,则判断此手机号码是否被商家主账号注册
+		user, err := db.GetUserByPhone(ctx, phoneNumber)
+		if err != nil {
+			// 数据库操作错误
+			return "", err
+		} else if user == nil {
+			// 没有被商家主账户注册,则可以注册
+			vcode, err := l.getSessionCode(ctx, phoneNumber)
+			if err != nil {
+				return "session err", err
+			}
+			fmt.Printf("缓存的验证码 vcode: %v,实际填入的 code:%v", vcode, code)
+			if vcode != code {
+				// 验证码错误
+				logrus.Debugf("[AuthCode] auth fail,phone:%+v", phone)
+				return "验证码有误", errors.New("auth fail")
+			}
+			return "1", err
+		} else if string(user.Role) == consts.BRole {
+			if user.AuthStatus == 1 {
+				// 被商家主账户注册,未认证,则可以注册
+				vcode, err := l.getSessionCode(ctx, phoneNumber)
+				if err != nil {
+					return "session err", err
+				}
+				fmt.Printf("缓存的验证码 vcode: %v,实际填入的 code:%v", vcode, code)
+				if vcode != code {
+					// 验证码错误
+					logrus.Debugf("[AuthCode] auth fail,phone:%+v", phone)
+					return "验证码有误", errors.New("auth fail")
+				}
+				return "1", err
+			} else {
+				return "主账号存在", errors.New("auth fail")
+			}
+		}
+	} else if user != nil {
+		// 子账号存在,则无法注册
+		logrus.Debugf("[AuthCode] auth fail,phone:%+v", phone)
+		return "子账号存在", errors.New("auth fail")
+	}
+	return "", nil
+
+}

+ 26 - 0
service/product.go

@@ -3,6 +3,7 @@ package service
 import (
 	"context"
 	"fmt"
+	"github.com/lin-jim-leon/kuaishou"
 	"strconv"
 	"youngee_b_api/consts"
 	"youngee_b_api/db"
@@ -168,3 +169,28 @@ func (*product) GetAllProduct(ctx context.Context, req *http_model.GetAllProduct
 	ProjectBriefInfoPreview.Total = strconv.FormatInt(total, 10)
 	return ProjectBriefInfoPreview, nil
 }
+
+// QueryKuaishouProduct 通过快手商品ID从SDK拉取快手商品信息
+func (*product) QueryKuaishouProduct(ctx context.Context, newKuaishouProduct http_model.FindKuaishouProductRequest) (*http_model.FindKuaishouProductData, error) {
+	AccessToken := "ChFvYXV0aC5hY2Nlc3NUb2tlbhJgpNyhn_OyOXO-hSkJDAmlssr8lCAzT0CePeh-9-NyQEK3quECYOVm40RG0ppGMSnV0xq-_hlLrO7BoBOj-ai75oD4hzJ1QDNWChUhEZaXWwv9BtHAPp4Hioa08mw3ZiakGhI3fO2jrXtNfq7z9Xoxtovjx-YiINfD-RUDsg0A2tscTHxuBVd4yaWdtWWbN9QNeaTOLf31KAUwAQ"
+	appKey := "ks651333097154138217"
+	signSecret := "bf6393dce0a2b669ee348bebb837b0da"
+	kuaishouProduct, err := kuaishou.Queryselectiondetail(appKey, signSecret, AccessToken, newKuaishouProduct.ItemList)
+	if err != nil {
+		return nil, err
+	}
+	fmt.Println("kuaishouProduct: ", kuaishouProduct)
+	findKuaishouProductData := http_model.FindKuaishouProductData{
+		ProductName:                 kuaishouProduct.ItemList[0].ItemTitle,
+		ProductPrice:                float64(kuaishouProduct.ItemList[0].ItemPrice) * 0.01,
+		ExclusiveCommission:         float64(kuaishouProduct.ItemList[0].CommissionRate) * 0.1,
+		CommissionPrice:             float64(kuaishouProduct.ItemList[0].ProfitAmount) * 0.01,
+		KuaishouMainPhoto:           kuaishouProduct.ItemList[0].ItemImgURL,
+		KuaishouCarousePhotoList:    kuaishouProduct.ItemList[0].ItemGalleryURLs,
+		KuaishouDetailPhotoList:     kuaishouProduct.ItemList[0].ItemDescURLs,
+		MerchantSoldCountThirtyDays: kuaishouProduct.ItemList[0].MerchantSoldCountThirtyDays,
+		KuaishouProductId:           kuaishouProduct.ItemList[0].ItemID,
+	}
+	// print("kuaoshou_product: ", findKuaishouProductData.ProductName)
+	return &findKuaishouProductData, err
+}

+ 1 - 0
service/sectask_service/logistics.go

@@ -47,6 +47,7 @@ func (*logistics) Create(ctx context.Context, request http_model.CreateSecTaskLo
 		LogisticsStatus: 2,
 		TaskStage:       8,
 		DeliveryDate:    time.Now(),
+		FreeStage:       4,
 	}
 	_, err = db.UpdateSecTask(ctx, updatdSecTask)
 	if err != nil {

+ 3 - 3
service/send_code.go

@@ -1,7 +1,7 @@
 package service
 
 import (
-	// "apig-review_service/go/core"
+	// "apig-sdk/go/core"
 	"bytes"
 	"context"
 	"crypto/sha256"
@@ -26,10 +26,10 @@ import (
 
 var SendCode *sendCode
 
-// 无需修改,用于格式化鉴权头域,给"X-WSSE"参数赋值
+//无需修改,用于格式化鉴权头域,给"X-WSSE"参数赋值
 const WSSE_HEADER_FORMAT = "UsernameToken Username=\"%s\",PasswordDigest=\"%s\",Nonce=\"%s\",Created=\"%s\""
 
-// 无需修改,用于格式化鉴权头域,给"Authorization"参数赋值
+//无需修改,用于格式化鉴权头域,给"Authorization"参数赋值
 const AUTH_HEADER_VALUE = "WSSE realm=\"SDP\",profile=\"UsernameToken\",type=\"Appkey\""
 
 func SendCodeInit(config *system_model.Session) {

+ 74 - 0
service/sub_account.go

@@ -0,0 +1,74 @@
+package service
+
+import (
+	"context"
+	"fmt"
+	log "github.com/sirupsen/logrus"
+	"time"
+	"youngee_b_api/db"
+	"youngee_b_api/model/gorm_model"
+	"youngee_b_api/model/http_model"
+)
+
+var SubAccount *subaccount
+
+type subaccount struct {
+}
+
+// CreateSubAccount 新增子账号
+func (*subaccount) CreateSubAccount(ctx context.Context, request http_model.AddNewSubAccountRequest) error {
+	user := gorm_model.YounggeeUser{
+		Phone:         request.PhoneNumber,
+		User:          "1002",
+		Username:      request.PhoneNumber,
+		Password:      "1002",
+		RealName:      "",
+		Role:          "4",
+		Email:         "",
+		LastLoginTime: time.Now().UTC().Local(),
+	}
+	userId, err := db.CreateUser(ctx, user)
+	if err != nil {
+		log.Infof("[CreateEnterpriseSubUser] fail,err:%+v", err)
+		return err
+	}
+	fmt.Println("userId: ", userId)
+	var curr = int(*userId)
+
+	var newSubAccount = gorm_model.YounggeeSubAccount{
+		PhoneNumber:    request.PhoneNumber,
+		SubAccountName: request.SubAccountName,
+		JobId:          request.JobId,
+		EnterpriseId:   request.EnterpriseId,
+		AccountStatus:  1,
+		UserId:         curr,
+		SubAccountType: 1,
+	}
+	err1 := db.CreateSubAccount(ctx, newSubAccount)
+	if err1 != nil {
+		return err1
+	}
+	return nil
+}
+
+// UpdateSubAccount 修改子账号
+func (*subaccount) UpdateSubAccount(ctx context.Context, request http_model.UpdateJobRequest) error {
+	var newSubAccount = gorm_model.YounggeeSubAccount{}
+	err := db.UpdateSubAccount(ctx, newSubAccount)
+	if err != nil {
+		return err
+	}
+	return nil
+}
+
+// DeleteSubAccount 删除子账号
+func (*subaccount) DeleteSubAccount(ctx context.Context, request http_model.DeleteJobRequest) error {
+	var newSubAccount = gorm_model.YounggeeSubAccount{
+		JobId: request.JobId,
+	}
+	err := db.DeleteSubAccount(ctx, newSubAccount)
+	if err != nil {
+		return err
+	}
+	return nil
+}