Răsfoiți Sursa

enterprise_account

Xingyu Xian 1 săptămână în urmă
părinte
comite
7fee49a899

+ 24 - 0
db/enterprise.go

@@ -4,6 +4,7 @@ import (
 	"context"
 	"fmt"
 	"github.com/issue9/conv"
+	"github.com/sirupsen/logrus"
 	"log"
 	"strconv"
 	"time"
@@ -215,3 +216,26 @@ func UpdateEnterprise(ctx context.Context, EnterpriseID string, BusinessName str
 	}
 	return nil
 }
+
+// CountEnterpriseUserByPhone 按照手机号码统计服务商数量
+func CountEnterpriseUserByPhone(ctx context.Context, phone string) (int64, error) {
+	db := GetReadDB(ctx)
+	var taskNum int64
+	err := db.Model(gorm_model.Enterprise{}).Where("phone = ?", phone).Count(&taskNum).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[CountSupplierUserByPhone] error read mysql, err:%+v", err)
+		return 0, err
+	}
+	return taskNum, nil
+}
+
+// UpdateEnterpriseById 更新商家信息
+func UpdateEnterpriseById(ctx context.Context, enterpriseInfo *gorm_model.Enterprise) error {
+	db := GetWriteDB(ctx)
+	whereCondition := gorm_model.Enterprise{EnterpriseID: enterpriseInfo.EnterpriseID}
+	err := db.Model(&gorm_model.Enterprise{}).Where(whereCondition).Updates(enterpriseInfo).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}

+ 31 - 1
db/sub_account.go

@@ -3,6 +3,7 @@ package db
 import (
 	"context"
 	"fmt"
+	"github.com/sirupsen/logrus"
 	"youngee_b_api/model/gorm_model"
 )
 
@@ -17,7 +18,7 @@ func CreateSubAccount(ctx context.Context, account gorm_model.YounggeeSubAccount
 }
 
 // UpdateSubAccount 更新子账号
-func UpdateSubAccount(ctx context.Context, account gorm_model.YounggeeSubAccount) error {
+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
@@ -70,3 +71,32 @@ func FindSubAccountByEnterpriseId(ctx context.Context, enterpriseId string, jobI
 	}
 	return subAccount, total, nil
 }
+
+// FindSubAccountById 根据Id查询子账号
+func FindSubAccountById(ctx context.Context, subAccountId int) (*gorm_model.YounggeeSubAccount, error) {
+	db := GetReadDB(ctx)
+	var total int64
+	var subAccount *gorm_model.YounggeeSubAccount
+	whereCondition := gorm_model.YounggeeSubAccount{SubAccountId: subAccountId, 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
+}
+
+// CountSubAccountUserByPhone 按照手机号码统计子账号数量
+func CountSubAccountUserByPhone(ctx context.Context, phone string) (int64, error) {
+	db := GetReadDB(ctx)
+	var taskNum int64
+	err := db.Model(gorm_model.YounggeeSubAccount{}).Where("phone_number = ? and sub_account_type = 1", phone).Count(&taskNum).Error
+	if err != nil {
+		logrus.WithContext(ctx).Errorf("[CountSubAccountUserByPhone] error read mysql, err:%+v", err)
+		return 0, err
+	}
+	return taskNum, nil
+}

+ 11 - 0
db/user.go

@@ -71,3 +71,14 @@ func UpdateUser(ctx context.Context, UserID int64, UserName string, Email string
 	}
 	return &UserID, nil
 }
+
+// UpdateUserById 更新User信息ById
+func UpdateUserById(ctx context.Context, userInfo *gorm_model.YounggeeUser) error {
+	db := GetWriteDB(ctx)
+	whereCondition := gorm_model.YounggeeUser{ID: userInfo.ID}
+	err := db.Model(&gorm_model.YounggeeUser{}).Where(whereCondition).Updates(userInfo).Error
+	if err != nil {
+		return err
+	}
+	return nil
+}

+ 1 - 2
handler/delete_sub_account.go

@@ -1,7 +1,6 @@
 package handler
 
 import (
-	"fmt"
 	"github.com/gin-gonic/gin"
 	"youngee_b_api/model/http_model"
 	"youngee_b_api/service"
@@ -40,7 +39,7 @@ func (h *DeleteSubAccountHandler) run() {
 	subAccountData = *h.req
 	err := service.SubAccount.DeleteSubAccount(h.ctx, subAccountData)
 	if err != nil {
-		fmt.Println(err)
+		// fmt.Println(err)
 		h.resp.Status = 40000
 		h.resp.Message = err.Error()
 		return

+ 58 - 0
handler/get_account_info.go

@@ -0,0 +1,58 @@
+package handler
+
+import (
+	"github.com/gin-gonic/gin"
+	"github.com/sirupsen/logrus"
+	log "github.com/sirupsen/logrus"
+	"youngee_b_api/consts"
+	"youngee_b_api/model/http_model"
+	"youngee_b_api/service"
+	"youngee_b_api/util"
+)
+
+func WrapGetAccountInfoHandler(ctx *gin.Context) {
+	handler := newGetAccountInfoHandler(ctx)
+	baseRun(handler)
+}
+
+func newGetAccountInfoHandler(ctx *gin.Context) *GetAccountInfoHandler {
+	return &GetAccountInfoHandler{
+		req:  http_model.NewGetAccountInfoRequest(),
+		resp: http_model.NewGetAccountInfoResponse(),
+		ctx:  ctx,
+	}
+}
+
+type GetAccountInfoHandler struct {
+	req  *http_model.GetAccountInfoRequest
+	resp *http_model.CommonResponse
+	ctx  *gin.Context
+}
+
+func (h *GetAccountInfoHandler) getRequest() interface{} {
+	return h.req
+}
+func (h *GetAccountInfoHandler) getContext() *gin.Context {
+	return h.ctx
+}
+func (h *GetAccountInfoHandler) getResponse() interface{} {
+	return h.resp
+}
+func (h *GetAccountInfoHandler) run() {
+	data, err := service.Enterprise.GetEnterpriseAccountInfo(h.ctx, h.req)
+	if err != nil {
+		logrus.Errorf("[GetEnterpriseAccountInfo] call SetSession err:%+v\n", err)
+		util.HandlerPackErrorResp(h.resp, consts.ErrorInternal, err.Error())
+		log.Info("GetEnterpriseAccountInfo fail,req:%+v", h.req)
+		h.resp.Message = err.Error()
+		h.resp.Status = 40000
+		return
+	}
+	h.resp.Data = data
+	h.resp.Status = 20000
+	h.resp.Message = "ok"
+}
+
+func (h *GetAccountInfoHandler) checkParam() error {
+	return nil
+}

+ 58 - 0
handler/get_contact_info.go

@@ -0,0 +1,58 @@
+package handler
+
+import (
+	"github.com/gin-gonic/gin"
+	"github.com/sirupsen/logrus"
+	log "github.com/sirupsen/logrus"
+	"youngee_b_api/consts"
+	"youngee_b_api/model/http_model"
+	"youngee_b_api/service"
+	"youngee_b_api/util"
+)
+
+func WrapGetContactInfoHandler(ctx *gin.Context) {
+	handler := newGetContactInfoHandler(ctx)
+	baseRun(handler)
+}
+
+func newGetContactInfoHandler(ctx *gin.Context) *GetContactInfoHandler {
+	return &GetContactInfoHandler{
+		req:  http_model.NewGetContactInfoRequest(),
+		resp: http_model.NewGetContactInfoResponse(),
+		ctx:  ctx,
+	}
+}
+
+type GetContactInfoHandler struct {
+	req  *http_model.GetContactInfoRequest
+	resp *http_model.CommonResponse
+	ctx  *gin.Context
+}
+
+func (h *GetContactInfoHandler) getRequest() interface{} {
+	return h.req
+}
+func (h *GetContactInfoHandler) getContext() *gin.Context {
+	return h.ctx
+}
+func (h *GetContactInfoHandler) getResponse() interface{} {
+	return h.resp
+}
+func (h *GetContactInfoHandler) run() {
+	data, err := service.Enterprise.GetEnterpriseContactInfo(h.ctx, h.req)
+	if err != nil {
+		logrus.Errorf("[FindSubAccountByEnterpriseId] call SetSession err:%+v\n", err)
+		util.HandlerPackErrorResp(h.resp, consts.ErrorInternal, err.Error())
+		log.Info("FindSubAccountByEnterpriseId fail,req:%+v", h.req)
+		h.resp.Message = err.Error()
+		h.resp.Status = 40000
+		return
+	}
+	h.resp.Data = data
+	h.resp.Status = 20000
+	h.resp.Message = "ok"
+}
+
+func (h *GetContactInfoHandler) checkParam() error {
+	return nil
+}

+ 59 - 0
handler/get_review_info.go

@@ -0,0 +1,59 @@
+package handler
+
+import (
+	"github.com/gin-gonic/gin"
+	"github.com/sirupsen/logrus"
+	log "github.com/sirupsen/logrus"
+	"youngee_b_api/consts"
+	"youngee_b_api/model/http_model"
+	"youngee_b_api/service"
+	"youngee_b_api/util"
+)
+
+func WrapGetReviewInfoHandler(ctx *gin.Context) {
+	handler := newGetReviewInfoHandler(ctx)
+	baseRun(handler)
+}
+
+func newGetReviewInfoHandler(ctx *gin.Context) *GetReviewInfoHandler {
+	return &GetReviewInfoHandler{
+		req:  http_model.NewGetReviewInfoRequest(),
+		resp: http_model.NewGetReviewInfoResponse(),
+		ctx:  ctx,
+	}
+}
+
+type GetReviewInfoHandler struct {
+	req  *http_model.GetReviewInfoRequest
+	resp *http_model.CommonResponse
+	ctx  *gin.Context
+}
+
+func (h *GetReviewInfoHandler) getRequest() interface{} {
+	return h.req
+}
+
+func (h *GetReviewInfoHandler) getContext() *gin.Context {
+	return h.ctx
+}
+func (h *GetReviewInfoHandler) getResponse() interface{} {
+	return h.resp
+}
+func (h *GetReviewInfoHandler) run() {
+	data, err := service.Enterprise.GetEnterpriseReviewInfo(h.ctx, h.req)
+	if err != nil {
+		logrus.Errorf("[GetEnterpriseReviewInfo] call SetSession err:%+v\n", err)
+		util.HandlerPackErrorResp(h.resp, consts.ErrorInternal, err.Error())
+		log.Info("GetEnterpriseReviewInfo fail,req:%+v", h.req)
+		h.resp.Message = err.Error()
+		h.resp.Status = 40000
+		return
+	}
+	h.resp.Data = data
+	h.resp.Status = 20000
+	h.resp.Message = "ok"
+}
+
+func (h *GetReviewInfoHandler) checkParam() error {
+	return nil
+}

+ 73 - 0
handler/update_account_info.go

@@ -0,0 +1,73 @@
+package handler
+
+import (
+	"github.com/gin-gonic/gin"
+	"github.com/sirupsen/logrus"
+	log "github.com/sirupsen/logrus"
+	"youngee_b_api/consts"
+	"youngee_b_api/model/http_model"
+	"youngee_b_api/service"
+	"youngee_b_api/util"
+)
+
+func WrapUpdateAccountInfoHandler(ctx *gin.Context) {
+	handler := newUpdateAccountInfoHandler(ctx)
+	baseRun(handler)
+}
+
+func newUpdateAccountInfoHandler(ctx *gin.Context) *UpdateAccountInfoHandler {
+	return &UpdateAccountInfoHandler{
+		req:  http_model.NewUpdateAccountInfoRequest(),
+		resp: http_model.NewUpdateAccountInfoResponse(),
+		ctx:  ctx,
+	}
+}
+
+type UpdateAccountInfoHandler struct {
+	req  *http_model.UpdateAccountInfoRequest
+	resp *http_model.CommonResponse
+	ctx  *gin.Context
+}
+
+func (h *UpdateAccountInfoHandler) getRequest() interface{} {
+	return h.req
+}
+func (h *UpdateAccountInfoHandler) getContext() *gin.Context {
+	return h.ctx
+}
+func (h *UpdateAccountInfoHandler) getResponse() interface{} {
+	return h.resp
+}
+func (h *UpdateAccountInfoHandler) run() {
+	data, tag, err := service.LoginAuth.UpdateEnterpriseAccountInfo(h.ctx, h.req)
+	if err != nil {
+		logrus.Errorf("[UpdateSupplierAccountInfo] call SetSession err:%+v\n", err)
+		util.HandlerPackErrorResp(h.resp, consts.ErrorInternal, err.Error())
+		log.Info("UpdateSupplierAccountInfo fail,req:%+v", h.req)
+		h.resp.Message = err.Error()
+		h.resp.Status = 40000
+		return
+	}
+	if tag == 1 {
+		h.resp.Message = "验证码校验错误"
+		h.resp.Status = 34000
+		return
+	}
+	if tag == 2 {
+		h.resp.Message = "手机号已经被其他主账号绑定"
+		h.resp.Status = 35000
+		return
+	}
+	if tag == 3 {
+		h.resp.Message = "手机号已经被其他子账号绑定"
+		h.resp.Status = 36000
+		return
+	}
+	h.resp.Data = data
+	h.resp.Status = 20000
+	h.resp.Message = "ok"
+}
+
+func (h *UpdateAccountInfoHandler) checkParam() error {
+	return nil
+}

+ 63 - 0
handler/update_contact_info.go

@@ -0,0 +1,63 @@
+package handler
+
+import (
+	"github.com/gin-gonic/gin"
+	"github.com/sirupsen/logrus"
+	log "github.com/sirupsen/logrus"
+	"youngee_b_api/consts"
+	"youngee_b_api/model/http_model"
+	"youngee_b_api/service"
+	"youngee_b_api/util"
+)
+
+func WrapUpdateContactInfoHandler(ctx *gin.Context) {
+	handler := newUpdateContactInfoHandler(ctx)
+	baseRun(handler)
+}
+
+func newUpdateContactInfoHandler(ctx *gin.Context) *UpdateContactInfoHandler {
+	return &UpdateContactInfoHandler{
+		req:  http_model.NewUpdateContactInfoRequest(),
+		resp: http_model.NewUpdateContactInfoResponse(),
+		ctx:  ctx,
+	}
+}
+
+type UpdateContactInfoHandler struct {
+	req  *http_model.UpdateContactInfoRequest
+	resp *http_model.CommonResponse
+	ctx  *gin.Context
+}
+
+func (h *UpdateContactInfoHandler) getRequest() interface{} {
+	return h.req
+}
+func (h *UpdateContactInfoHandler) getContext() *gin.Context {
+	return h.ctx
+}
+func (h *UpdateContactInfoHandler) getResponse() interface{} {
+	return h.resp
+}
+func (h *UpdateContactInfoHandler) run() {
+	data, tag, err := service.LoginAuth.UpdateEnterpriseContactInfo(h.ctx, h.req)
+	if err != nil {
+		logrus.Errorf("[FindSubAccountByEnterpriseId] call SetSession err:%+v\n", err)
+		util.HandlerPackErrorResp(h.resp, consts.ErrorInternal, err.Error())
+		log.Info("FindSubAccountByEnterpriseId fail,req:%+v", h.req)
+		h.resp.Message = err.Error()
+		h.resp.Status = 40000
+		return
+	}
+	if tag == true && data == nil {
+		h.resp.Message = "验证码校验错误"
+		h.resp.Status = 34000
+		return
+	}
+	h.resp.Data = data
+	h.resp.Status = 20000
+	h.resp.Message = "ok"
+}
+
+func (h *UpdateContactInfoHandler) checkParam() error {
+	return nil
+}

+ 24 - 13
model/gorm_model/enterprise.go

@@ -1,23 +1,34 @@
-// Code generated by sql2gorm. DO NOT EDIT.
 package gorm_model
 
 import (
 	"time"
 )
 
+// Enterprise 企业用户表
 type Enterprise struct {
-	EnterpriseID     string     `gorm:"column:enterprise_id"`     // 企业id,用户ID的生成规则为:1(企业用户代码)+分秒数字+四位随机数字
-	Industry         int64     `gorm:"column:industry"`          // 行业,1-14分别代表能源、化工、材料、机械设备/军工、企业服务/造纸印刷、运输设备、旅游酒店、媒体/信息通信服务、批发/零售、消费品、卫生保健/医疗、金融、建材/建筑/房地产、公共事业
-	BusinessName     string    `gorm:"column:business_name"`     // 公司或组织名称
-	UserID           int64     `gorm:"column:user_id"`           // 对应用户id
-	Balance          float64   `gorm:"column:balance"`           // 账户余额
-	FrozenBalance    float64   `gorm:"column:frozen_balance"`    // 冻结余额
-	AvailableBalance float64   `gorm:"column:available_balance"` // 可用余额
-	BillableAmount   float64   `gorm:"column:billable_amount"`   // 可开票金额
-	Invoicing        float64   `gorm:"column:invoicing"`         // 开票中金额
-	Recharging       float64   `gorm:"column:recharging"`        // 充值中金额
-	CreatedAt        time.Time `gorm:"column:created_at"`        // 创建时间
-	UpdatedAt        time.Time `gorm:"column:updated_at"`        // 更新时间
+	EnterpriseID     string    `gorm:"column:enterprise_id;primary_key"`      // 企业id,用户ID的生成规则为:1(企业用户代码)+分秒数字+四位随机数字
+	Industry         int64     `gorm:"column:industry"`                       // 行业,1-14分别代表能源、化工、材料、机械设备/军工、企业服务/造纸印刷、运输设备、旅游酒店、媒体/信息通信服务、批发/零售、消费品、卫生保健/医疗、金融、建材/建筑/房地产、公共事业
+	BusinessName     string    `gorm:"column:business_name"`                  // 公司或组织名称
+	TaxNumber        string    `gorm:"column:tax_number"`                     // 企业税号
+	Address          string    `gorm:"column:address"`                        // 公司注册地址
+	UserID           int64     `gorm:"column:user_id"`                        // 对应用户id
+	Balance          float64   `gorm:"column:balance"`                        // 账户余额
+	FrozenBalance    float64   `gorm:"column:frozen_balance"`                 // 冻结余额
+	AvailableBalance float64   `gorm:"column:available_balance"`              // 可用余额
+	BillableAmount   float64   `gorm:"column:billable_amount"`                // 可开票金额(3.0暂未用到)
+	Invoicing        float64   `gorm:"column:invoicing"`                      // 开票中金额(3.0暂未用到)
+	Recharging       float64   `gorm:"column:recharging"`                     // 充值中金额(3.0暂未用到)
+	CreatedAt        time.Time `gorm:"column:created_at"`                     // 创建时间
+	UpdatedAt        time.Time `gorm:"column:updated_at"`                     // 更新时间
+	AuthStatus       int       `gorm:"column:auth_status;default:0;NOT NULL"` // 商家认证状态,0未认证,1已认证
+	Avatar           string    `gorm:"column:avatar;NOT NULL"`                // 头像
+	Phone            string    `gorm:"column:phone;NOT NULL"`                 // 手机号
+	ContactPhone     string    `gorm:"column:contact_phone"`                  // 联系方式手机(不一定是绑定的手机号)
+	WechatNumber     string    `gorm:"column:wechat_number"`                  // 微信号
+	WechatQrCode     string    `gorm:"column:wechat_qr_code"`                 // 微信二维码
+	BusinessLicense  string    `gorm:"column:business_license"`               // 营业执照url
+	Usci             string    `gorm:"column:usci"`                           // 统一社会信用代码
+	EnterpriseName   string    `gorm:"column:enterprise_name"`                // 商家用户名称
 }
 
 func (m *Enterprise) TableName() string {

+ 5 - 0
model/gorm_model/sub_account.go

@@ -9,6 +9,11 @@ type YounggeeSubAccount struct {
 	AccountStatus  int    `gorm:"column:account_status"`                            // 账号状态,1为正常,2为停用
 	UserId         int    `gorm:"column:user_id"`                                   // 用户表中ID
 	SubAccountType int    `gorm:"column:sub_account_type"`                          // 子账号类型,1为商家端子账号,2为管理后台子账号
+	SupplierId     int    `gorm:"column:supplier_id"`                               // 所属服务商ID
+	Avatar         string `gorm:"column:avatar"`                                    // 头像
+	ContactPhone   string `gorm:"column:contact_phone"`                             // 联系电话
+	WechatNumber   string `gorm:"column:wechat_number"`                             // 微信号
+	WechatQRCode   string `gorm:"column:wechat_qr_code"`                            // 微信二维码url
 }
 
 func (m *YounggeeSubAccount) TableName() string {

+ 25 - 0
model/http_model/get_account_info.go

@@ -0,0 +1,25 @@
+package http_model
+
+type GetAccountInfoRequest struct {
+	EnterpriseId string `json:"enterprise_id"`  // 商家ID
+	SubAccountId int    `json:"sub_account_id"` // 子账号ID
+}
+
+type GetAccountInfoData struct {
+	Type           int    `json:"type"`             // 账号类型,1主账号,2子账号
+	Phone          string `json:"phone"`            // 绑定手机号
+	EnterpriseName string `json:"enterprise_name"`  // 商家名称
+	Avatar         string `json:"avatar"`           // 头像url
+	SubAccountName string `json:"sub_account_name"` // 子账号名称
+	JobName        string `json:"job_name"`         // 子账号岗位名称
+}
+
+func NewGetAccountInfoRequest() *GetAccountInfoRequest {
+	return new(GetAccountInfoRequest)
+}
+
+func NewGetAccountInfoResponse() *CommonResponse {
+	resp := new(CommonResponse)
+	resp.Data = new(GetAccountInfoData)
+	return resp
+}

+ 22 - 0
model/http_model/get_contact_info.go

@@ -0,0 +1,22 @@
+package http_model
+
+type GetContactInfoRequest struct {
+	EnterpriseId string `json:"enterprise_id"`  // 商家ID
+	SubAccountId int    `json:"sub_account_id"` // 子账号ID
+}
+
+type GetContactInfoData struct {
+	ContactPhone string `json:"contact_phone"`  // 联系电话
+	WechatNumber string `json:"wechat_number"`  // 微信号
+	WechatQRCode string `json:"wechat_qr_code"` // 微信二维码
+}
+
+func NewGetContactInfoRequest() *GetContactInfoRequest {
+	return new(GetContactInfoRequest)
+}
+
+func NewGetContactInfoResponse() *CommonResponse {
+	resp := new(CommonResponse)
+	resp.Data = new(GetContactInfoData)
+	return resp
+}

+ 23 - 0
model/http_model/get_review_info.go

@@ -0,0 +1,23 @@
+package http_model
+
+type GetReviewInfoRequest struct {
+	EnterpriseId string `json:"enterprise_id"` // 商家ID
+}
+
+type GetReviewInfoData struct {
+	ReviewType      int    `json:"review_type"`      // 认证方式,1营业执照认证,2其他
+	ReviewStatus    int    `json:"review_status"`    // 认证状态,1未认证,2已认证
+	USCI            string `json:"usci"`             // 统一社会信用代码
+	CompanyName     string `json:"company_name"`     // 公司名称
+	BusinessLicense string `json:"business_license"` // 营业执照url
+}
+
+func NewGetReviewInfoRequest() *GetReviewInfoRequest {
+	return new(GetReviewInfoRequest)
+}
+
+func NewGetReviewInfoResponse() *CommonResponse {
+	resp := new(CommonResponse)
+	resp.Data = new(GetReviewInfoData)
+	return resp
+}

+ 28 - 0
model/http_model/update_account_info.go

@@ -0,0 +1,28 @@
+package http_model
+
+type UpdateAccountInfoRequest struct {
+	EnterpriseId   string `json:"enterprise_id"`    // 商家ID
+	SubAccountId   int    `json:"sub_account_id"`   // 子账号ID
+	Phone          string `json:"phone"`            // 绑定手机号
+	Code           string `json:"code"`             // 验证码
+	EnterpriseName string `json:"enterprise_name"`  // 商家名称
+	Avatar         string `json:"avatar"`           // 头像url
+	SubAccountName string `json:"sub_account_name"` // 子账号名称
+}
+
+type UpdateAccountInfoData struct {
+	Phone          string `json:"phone"`            // 绑定手机号
+	EnterpriseName string `json:"enterprise_name"`  // 商家名称
+	Avatar         string `json:"avatar"`           // 头像url
+	SubAccountName string `json:"sub_account_name"` // 子账号名称
+}
+
+func NewUpdateAccountInfoRequest() *UpdateAccountInfoRequest {
+	return new(UpdateAccountInfoRequest)
+}
+
+func NewUpdateAccountInfoResponse() *CommonResponse {
+	resp := new(CommonResponse)
+	resp.Data = new(UpdateAccountInfoData)
+	return resp
+}

+ 26 - 0
model/http_model/update_contact_info.go

@@ -0,0 +1,26 @@
+package http_model
+
+type UpdateContactInfoRequest struct {
+	EnterpriseId string `json:"enterprise_id"`  // 商家ID
+	SubAccountId int    `json:"sub_account_id"` // 子账号ID
+	ContactPhone string `json:"contact_phone"`  // 联系电话
+	WechatNumber string `json:"wechat_number"`  // 微信号
+	WechatQRCode string `json:"wechat_qr_code"` // 微信二维码
+	Code         string `json:"code"`           // 验证码
+}
+
+type UpdateContactInfoData struct {
+	ContactPhone string `json:"contact_phone"`  // 联系电话
+	WechatNumber string `json:"wechat_number"`  // 微信号
+	WechatQRCode string `json:"wechat_qr_code"` // 微信二维码
+}
+
+func NewUpdateContactInfoRequest() *UpdateContactInfoRequest {
+	return new(UpdateContactInfoRequest)
+}
+
+func NewUpdateContactInfoResponse() *CommonResponse {
+	resp := new(CommonResponse)
+	resp.Data = new(UpdateContactInfoData)
+	return resp
+}

+ 12 - 8
route/init.go

@@ -20,13 +20,18 @@ func InitRoute(r *gin.Engine) {
 		business.POST("/findAllSubAccount", handler.WrapFindAllSubAccountHandler) // 查找商家全部所属子账号
 		business.POST("/deleteSubAccount", handler.WrapDeleteSubAccountHandler)   // 删除商家子账号
 		// business.POST("/updateSubAccount", handler.WrapUpdateSubAccountHandler)   // 修改商家子账号
-		business.POST("/findAllJob", handler.WrapFindAllJobHandler)   // 查找商家全部所属岗位
-		business.POST("/addNewJob", handler.WrapaddNewJobHandler)     // 商家新增岗位
-		business.POST("/updateJob", handler.WrapupdateJobHandler)     // 商家修改岗位
-		business.POST("/deleteJob", handler.WrapdeleteJobHandler)     // 商家删除岗位
-		business.POST("/sendCode", handler.WrapSendCodeHandler)       // 发送登录验证码
-		business.POST("/login", handler.WrapCodeLoginHandler)         // 商家登录
-		business.POST("/getUserInfo", handler.WrapGetUserInfoHandler) // 商家用户信息
+		business.POST("/findAllJob", handler.WrapFindAllJobHandler)                // 查找商家全部所属岗位
+		business.POST("/addNewJob", handler.WrapaddNewJobHandler)                  // 商家新增岗位
+		business.POST("/updateJob", handler.WrapupdateJobHandler)                  // 商家修改岗位
+		business.POST("/deleteJob", handler.WrapdeleteJobHandler)                  // 商家删除岗位
+		business.POST("/sendCode", handler.WrapSendCodeHandler)                    // 发送登录验证码
+		business.POST("/login", handler.WrapCodeLoginHandler)                      // 商家登录
+		business.POST("/getUserInfo", handler.WrapGetUserInfoHandler)              // 商家用户信息
+		business.POST("/accountInfo/get", handler.WrapGetAccountInfoHandler)       // 账号管理-账号信息查询
+		business.POST("/accountInfo/update", handler.WrapUpdateAccountInfoHandler) // 账号管理-账号信息更新
+		business.POST("/reviewInfo/get", handler.WrapGetReviewInfoHandler)         // 账号管理-认证信息查询
+		business.POST("/contactInfo/get", handler.WrapGetContactInfoHandler)       // 联系方式-查询
+		business.POST("/contactInfo/update", handler.WrapUpdateContactInfoHandler) // 联系方式-更新
 		business.GET("/test/ping", func(c *gin.Context) {
 			resp := http_model.CommonResponse{
 				Status:  20000,
@@ -180,7 +185,6 @@ func InitRoute(r *gin.Engine) {
 		workspace.POST("/warehouseInvite", controller.WorkspaceController{}.GetWarehouseInvite) // 合作待办-入库邀约
 		// 财务待办
 		workspace.POST("/finance", controller.WorkspaceController{}.GetFinance) // 财务待办-充值与发票
-
 	}
 	// 任务中心相关接口
 	task := r.Group("/youngee/b/task")

+ 107 - 32
service/enterprise.go

@@ -70,7 +70,7 @@ func (*enterprise) CreateEnterpriseUser(ctx context.Context, newEnterprise http_
 }
 
 func (*enterprise) CreateEnterprise(ctx context.Context, phone string) (*http_model.RegisterData, error) {
-	user := gorm_model.YounggeeUser{
+	userInfo := gorm_model.YounggeeUser{
 		Phone:         phone,
 		User:          "1001",
 		Username:      phone,
@@ -80,10 +80,10 @@ func (*enterprise) CreateEnterprise(ctx context.Context, phone string) (*http_mo
 		Email:         "",
 		LastLoginTime: time.Now().UTC().Local(),
 	}
-	userId, err := db.CreateUser(ctx, user)
-	if err != nil {
-		log.Infof("[CreateEnterpriseUser] fail,err:%+v", err)
-		return nil, err
+	userId, createUserErr := db.CreateUser(ctx, userInfo)
+	if createUserErr != nil {
+		log.Infof("[CreateEnterpriseUser] fail,err:%+v", createUserErr)
+		return nil, createUserErr
 	} else {
 		rand.Seed(time.Now().UnixNano())
 		th := conv.MustString(time.Now().Hour())
@@ -95,7 +95,7 @@ func (*enterprise) CreateEnterprise(ctx context.Context, phone string) (*http_mo
 			th = "0" + th
 		}
 		ShowEnterpriseID := "1" + th + tm + conv.MustString(rand.Intn(10000-1000)+1000)
-		enterprise := &gorm_model.Enterprise{
+		enterpriseInfo := &gorm_model.Enterprise{
 			EnterpriseID:     ShowEnterpriseID,
 			Industry:         1,
 			BusinessName:     phone,
@@ -103,11 +103,12 @@ func (*enterprise) CreateEnterprise(ctx context.Context, phone string) (*http_mo
 			Balance:          0,
 			FrozenBalance:    0,
 			AvailableBalance: 0,
+			Phone:            phone,
 		}
-		enterpriseId, err := db.CreateEnterprise(ctx, *enterprise)
-		if err != nil {
-			log.Infof("[CreateEnterpriseUser] fail,err:%+v", err)
-			return nil, err
+		enterpriseId, createEnterpriseErr := db.CreateEnterprise(ctx, *enterpriseInfo)
+		if createEnterpriseErr != nil {
+			log.Infof("[CreateEnterpriseUser] fail,err:%+v", createEnterpriseErr)
+			return nil, createEnterpriseErr
 		}
 		res := &http_model.RegisterData{
 			EnterpriseId: *enterpriseId,
@@ -117,30 +118,104 @@ func (*enterprise) CreateEnterprise(ctx context.Context, phone string) (*http_mo
 	}
 }
 
-// CreateEnterpriseSubUser ToDo
-// CreateEnterpriseSubUser 创建商家子账号
-func (*enterprise) CreateEnterpriseSubUser(ctx context.Context, newEnterprise http_model.RegisterRequest) (*http_model.RegisterData, error) {
-	// 1. 新建User
-	user := gorm_model.YounggeeUser{
-		Phone:         newEnterprise.Phone,
-		User:          "1001",
-		Username:      newEnterprise.BusinessName,
-		Password:      "1001",
-		RealName:      newEnterprise.RealName,
-		Role:          "3",
-		Email:         newEnterprise.Email,
-		LastLoginTime: time.Now().UTC().Local(),
+// GetEnterpriseAccountInfo 查询商家账号信息
+func (*enterprise) GetEnterpriseAccountInfo(ctx context.Context, req *http_model.GetAccountInfoRequest) (*http_model.GetAccountInfoData, error) {
+
+	var enterpriseUserInfo *http_model.GetAccountInfoData
+	enterpriseUserInfo = &http_model.GetAccountInfoData{}
+
+	if req.SubAccountId == 0 {
+		// 1. 商家主账号
+		enterpriseInfo, enterpriseInfoErr := db.GetEnterpriseByEnterpriseID(ctx, req.EnterpriseId)
+		if enterpriseInfoErr != nil {
+			log.Infof("[GetSupplierAccountInfo] fail,err:%+v", enterpriseInfoErr)
+			return nil, enterpriseInfoErr
+		}
+		if enterpriseInfo != nil {
+			enterpriseUserInfo.EnterpriseName = enterpriseInfo.EnterpriseName
+			enterpriseUserInfo.Type = 1
+			enterpriseUserInfo.Avatar = enterpriseInfo.Avatar
+			enterpriseUserInfo.Phone = enterpriseInfo.Phone
+		}
+	} else {
+		// 2. 商家子账号
+		subAccountInfo, subAccountInfoErr := db.FindSubAccountById(ctx, req.SubAccountId)
+		if subAccountInfoErr != nil {
+			log.Infof("[GetSupplierAccountInfo] fail,err:%+v", subAccountInfoErr)
+			return nil, subAccountInfoErr
+		}
+		if subAccountInfo != nil {
+			enterpriseUserInfo.SubAccountName = subAccountInfo.SubAccountName
+			enterpriseUserInfo.Type = 2
+			enterpriseUserInfo.Avatar = subAccountInfo.Avatar
+			enterpriseUserInfo.Phone = subAccountInfo.PhoneNumber
+			jobInfo, jobInfoErr := db.FindJobByJobId(ctx, subAccountInfo.JobId)
+			if jobInfoErr != nil {
+				log.Infof("[GetSupplierAccountInfo] fail,err:%+v", jobInfoErr)
+				return nil, subAccountInfoErr
+			}
+			if jobInfo != nil {
+				enterpriseUserInfo.JobName = jobInfo.JobName
+			}
+		}
 	}
-	userId, err := db.CreateUser(ctx, user)
+	return enterpriseUserInfo, nil
+}
 
-	// 2. 新建商家子账号
-	if err != nil {
-		log.Infof("[CreateEnterpriseUser] fail,err:%+v", err)
-		fmt.Println("User创建失败")
-		return nil, err
+// GetEnterpriseReviewInfo 查询商家认证信息
+func (*enterprise) GetEnterpriseReviewInfo(ctx context.Context, req *http_model.GetReviewInfoRequest) (*http_model.GetReviewInfoData, error) {
+
+	var enterpriseUserInfo *http_model.GetReviewInfoData
+	enterpriseUserInfo = &http_model.GetReviewInfoData{}
+
+	enterpriseInfo, enterpriseInfoErr := db.GetEnterpriseByEnterpriseID(ctx, req.EnterpriseId)
+	if enterpriseInfoErr != nil {
+		log.Infof("[GetEnterpriseByEnterpriseID] fail,err:%+v", enterpriseInfoErr)
+		return nil, enterpriseInfoErr
+	}
+	if enterpriseInfo != nil {
+		enterpriseUserInfo.ReviewType = 1
+		if enterpriseInfo.AuthStatus == 1 {
+			enterpriseUserInfo.ReviewStatus = 2
+		} else {
+			enterpriseUserInfo.ReviewStatus = 1
+		}
+		enterpriseUserInfo.BusinessLicense = enterpriseInfo.BusinessLicense
+		enterpriseUserInfo.USCI = enterpriseInfo.Usci
+		enterpriseUserInfo.CompanyName = enterpriseInfo.BusinessName
+	}
+	return enterpriseUserInfo, nil
+}
+
+// GetEnterpriseContactInfo 查询商家联系方式
+func (*enterprise) GetEnterpriseContactInfo(ctx context.Context, req *http_model.GetContactInfoRequest) (*http_model.GetContactInfoData, error) {
+
+	var contactInfo *http_model.GetContactInfoData
+	contactInfo = &http_model.GetContactInfoData{}
+	// 1. 商家主账号
+	if req.SubAccountId == 0 {
+		enterpriseInfo, enterpriseInfoErr := db.GetEnterpriseByEnterpriseID(ctx, req.EnterpriseId)
+		if enterpriseInfoErr != nil {
+			log.Infof("[enterpriseInfoErr] fail,err:%+v", enterpriseInfoErr)
+			return nil, enterpriseInfoErr
+		}
+		if enterpriseInfo != nil {
+			contactInfo.ContactPhone = enterpriseInfo.ContactPhone
+			contactInfo.WechatQRCode = enterpriseInfo.WechatQrCode
+			contactInfo.WechatNumber = enterpriseInfo.WechatNumber
+		}
 	} else {
-		fmt.Println("User创建成功,开始创建商家子账号")
-		fmt.Println(userId)
+		// 2. 商家子账号
+		subAccountInfo, subAccountInfoErr := db.FindSubAccountById(ctx, req.SubAccountId)
+		if subAccountInfoErr != nil {
+			log.Infof("[GetSupplierContactInfo] fail,err:%+v", subAccountInfoErr)
+			return nil, subAccountInfoErr
+		}
+		if subAccountInfo != nil {
+			contactInfo.ContactPhone = subAccountInfo.ContactPhone
+			contactInfo.WechatQRCode = subAccountInfo.WechatQRCode
+			contactInfo.WechatNumber = subAccountInfo.WechatNumber
+		}
 	}
-	return nil, err
+	return contactInfo, nil
 }

+ 219 - 0
service/login_auth.go

@@ -338,3 +338,222 @@ func (l *loginAuth) SubAccountAuthCode(ctx context.Context, req *http_model.AddN
 	}
 	return 0, nil
 }
+
+// UpdateEnterpriseAccountInfo 更新商家账号信息
+func (l *loginAuth) UpdateEnterpriseAccountInfo(ctx context.Context, req *http_model.UpdateAccountInfoRequest) (*http_model.UpdateAccountInfoData, int, error) {
+
+	var supplierUserInfo *http_model.UpdateAccountInfoData
+	supplierUserInfo = &http_model.UpdateAccountInfoData{}
+	supplierUserInfo.EnterpriseName = req.EnterpriseName
+	supplierUserInfo.Avatar = req.Avatar
+	supplierUserInfo.Phone = req.Phone
+	supplierUserInfo.SubAccountName = req.SubAccountName
+
+	if req.SubAccountId == 0 {
+		// 商家主账号
+		// 1. 若修改绑定手机号
+		if req.Phone != "" {
+			// 1.1. 校验验证码
+			vCode, err := l.getSessionCode(ctx, req.Phone)
+			if err != nil {
+				return nil, 0, err
+			}
+			if vCode != req.Code {
+				return nil, 1, nil
+			}
+			// 1.2. 手机号是否已经被其他主账号绑定
+			enterpriseNum, enterpriseNumErr := db.CountEnterpriseUserByPhone(ctx, req.Phone)
+			if enterpriseNumErr != nil {
+				// log.Infof("[GetSupplierAccountInfo] fail,err:%+v", supplierNumErr)
+				return nil, 0, enterpriseNumErr
+			}
+			if enterpriseNum != 0 {
+				return nil, 2, nil
+			}
+			// 1.3. 手机号是否被子账号绑定
+			subAccountNum, SubAccountErr := db.CountSubAccountUserByPhone(ctx, req.Phone)
+			if SubAccountErr != nil {
+				// log.Infof("[GetSupplierAccountInfo] fail,err:%+v", SubAccountErr)
+				return nil, 0, SubAccountErr
+			}
+			if subAccountNum != 0 {
+				return nil, 3, nil
+			}
+			// 1.4. 修改Enterprise信息
+			var enterpriseInfo *gorm_model.Enterprise
+			enterpriseInfo = &gorm_model.Enterprise{}
+			enterpriseInfo.EnterpriseID = req.EnterpriseId
+			enterpriseInfo.EnterpriseName = req.EnterpriseName
+			enterpriseInfo.Avatar = req.Avatar
+			enterpriseInfo.Phone = req.Phone
+			updateEnterpriseErr := db.UpdateEnterpriseById(ctx, enterpriseInfo)
+			if updateEnterpriseErr != nil {
+				// log.Infof("[GetSupplierAccountInfo] fail,err:%+v", updateEnterpriseErr)
+				return nil, 0, updateEnterpriseErr
+			}
+			// 1.5. 修改User表信息
+			enterpriseInfoQuery, enterpriseInfoQueryErr := db.GetEnterpriseByEnterpriseID(ctx, enterpriseInfo.EnterpriseID)
+			if enterpriseInfoQueryErr != nil {
+				// log.Infof("[GetSupplierAccountInfo] fail,err:%+v", supplierInfoQueryErr)
+				return nil, 0, enterpriseInfoQueryErr
+			}
+			if enterpriseInfoQuery != nil {
+				var userInfo *gorm_model.YounggeeUser
+				userInfo = &gorm_model.YounggeeUser{}
+				userInfo.ID = enterpriseInfoQuery.UserID
+				userInfo.Phone = enterpriseInfoQuery.Phone
+				userInfo.Username = enterpriseInfoQuery.Phone
+				updateUserInfoErr := db.UpdateUserById(ctx, userInfo)
+				if updateUserInfoErr != nil {
+					// log.Infof("[GetSupplierAccountInfo] fail,err:%+v", updateUserInfoErr)
+					return nil, 0, updateUserInfoErr
+				}
+			}
+
+		} else {
+			var enterpriseInfo *gorm_model.Enterprise
+			enterpriseInfo = &gorm_model.Enterprise{}
+			enterpriseInfo.EnterpriseID = req.EnterpriseId
+			enterpriseInfo.EnterpriseName = req.EnterpriseName
+			enterpriseInfo.Avatar = req.Avatar
+			enterpriseInfo.Phone = req.Phone
+			updateEnterpriseErr := db.UpdateEnterpriseById(ctx, enterpriseInfo)
+			if updateEnterpriseErr != nil {
+				// log.Infof("[GetSupplierAccountInfo] fail,err:%+v", updateEnterpriseErr)
+				return nil, 0, updateEnterpriseErr
+			}
+		}
+	} else {
+		// 商家子账号
+		var subAccountInfo *gorm_model.YounggeeSubAccount
+		subAccountInfo = &gorm_model.YounggeeSubAccount{}
+		subAccountInfo.SubAccountType = 3
+		subAccountInfo.EnterpriseId = req.EnterpriseId
+		subAccountInfo.SubAccountId = req.SubAccountId
+		subAccountInfo.SubAccountName = req.SubAccountName
+		subAccountInfo.Avatar = req.Avatar
+		subAccountInfo.PhoneNumber = req.Phone
+		updateSubAccountErr := db.UpdateSubAccount(ctx, subAccountInfo)
+		if updateSubAccountErr != nil {
+			// log.Infof("[GetSupplierAccountInfo] fail,err:%+v", updateSubAccountErr)
+			return nil, 0, updateSubAccountErr
+		}
+	}
+	return supplierUserInfo, 0, nil
+}
+
+// UpdateEnterpriseContactInfo 更新商家联系方式
+func (l *loginAuth) UpdateEnterpriseContactInfo(ctx context.Context, req *http_model.UpdateContactInfoRequest) (*http_model.UpdateContactInfoData, bool, error) {
+
+	var contactInfo *http_model.UpdateContactInfoData
+	contactInfo = &http_model.UpdateContactInfoData{}
+
+	// 主账号
+	if req.SubAccountId == 0 {
+		// 1. 若更新联系电话则需要验证码校验
+		if req.ContactPhone != "" {
+			vcode, err := l.getSessionCode(ctx, req.ContactPhone)
+			if err != nil {
+				return nil, false, err
+			}
+			// fmt.Printf("缓存的验证码 vcode: %v,实际填入的 code:%v", vcode, req.Code)
+			if vcode != req.Code {
+				// 验证码错误
+				return nil, true, err
+			}
+			var enterpriseInfo *gorm_model.Enterprise
+			enterpriseInfo = &gorm_model.Enterprise{}
+			enterpriseInfo.ContactPhone = req.ContactPhone
+			enterpriseInfo.EnterpriseID = req.EnterpriseId
+			updateEnterpriseErr := db.UpdateEnterpriseById(ctx, enterpriseInfo)
+			if updateEnterpriseErr != nil {
+				// log.Infof("[updateEnterpriseErr] fail,err:%+v", updateEnterpriseErr)
+				return nil, false, updateEnterpriseErr
+			}
+			contactInfo.ContactPhone = req.ContactPhone
+		}
+
+		// 2. 微信二维码更新
+		if req.WechatQRCode != "" {
+			var enterpriseInfo *gorm_model.Enterprise
+			enterpriseInfo = &gorm_model.Enterprise{}
+			enterpriseInfo.WechatQrCode = req.WechatQRCode
+			enterpriseInfo.EnterpriseID = req.EnterpriseId
+			updateEnterpriseErr := db.UpdateEnterpriseById(ctx, enterpriseInfo)
+			if updateEnterpriseErr != nil {
+				// log.Infof("[UpdateSupplierContactInfo] fail,err:%+v", updateEnterpriseErr)
+				return nil, false, updateEnterpriseErr
+			}
+			contactInfo.WechatQRCode = req.WechatQRCode
+
+		}
+
+		// 2. 微信号码更新
+		if req.WechatNumber != "" {
+			var enterpriseInfo *gorm_model.Enterprise
+			enterpriseInfo = &gorm_model.Enterprise{}
+			enterpriseInfo.WechatNumber = req.WechatNumber
+			enterpriseInfo.EnterpriseID = req.EnterpriseId
+			updateEnterpriseErr := db.UpdateEnterpriseById(ctx, enterpriseInfo)
+			if updateEnterpriseErr != nil {
+				// log.Infof("[UpdateSupplierContactInfo] fail,err:%+v", updateEnterpriseErr)
+				return nil, false, updateEnterpriseErr
+			}
+			contactInfo.WechatNumber = req.WechatNumber
+		}
+	} else {
+		// 子账号
+		// 1. 若更新联系电话则需要验证码校验
+		if req.ContactPhone != "" {
+			vcode, err := l.getSessionCode(ctx, req.ContactPhone)
+			if err != nil {
+				return nil, false, err
+			}
+			// fmt.Printf("缓存的验证码 vcode: %v,实际填入的 code:%v", vcode, req.Code)
+			if vcode != req.Code {
+				// 验证码错误
+				return nil, true, err
+			}
+			var subAccountInfo *gorm_model.YounggeeSubAccount
+			subAccountInfo = &gorm_model.YounggeeSubAccount{}
+			subAccountInfo.ContactPhone = req.ContactPhone
+			subAccountInfo.SubAccountId = req.SubAccountId
+			updateSupplierErr := db.UpdateSubAccount(ctx, subAccountInfo)
+			if updateSupplierErr != nil {
+				// log.Infof("[UpdateSupplierContactInfo] fail,err:%+v", updateSupplierErr)
+				return nil, false, updateSupplierErr
+			}
+			contactInfo.ContactPhone = req.ContactPhone
+		}
+
+		// 2. 微信二维码更新
+		if req.WechatQRCode != "" {
+			var subAccountInfo *gorm_model.YounggeeSubAccount
+			subAccountInfo = &gorm_model.YounggeeSubAccount{}
+			subAccountInfo.WechatQRCode = req.WechatQRCode
+			subAccountInfo.SubAccountId = req.SubAccountId
+			updateSupplierErr := db.UpdateSubAccount(ctx, subAccountInfo)
+			if updateSupplierErr != nil {
+				// log.Infof("[UpdateSupplierContactInfo] fail,err:%+v", updateSupplierErr)
+				return nil, false, updateSupplierErr
+			}
+			contactInfo.WechatQRCode = req.WechatQRCode
+
+		}
+
+		// 2. 微信号码更新
+		if req.WechatNumber != "" {
+			var subAccountInfo *gorm_model.YounggeeSubAccount
+			subAccountInfo = &gorm_model.YounggeeSubAccount{}
+			subAccountInfo.WechatNumber = req.WechatNumber
+			subAccountInfo.SubAccountId = req.SubAccountId
+			updateSupplierErr := db.UpdateSubAccount(ctx, subAccountInfo)
+			if updateSupplierErr != nil {
+				// log.Infof("[UpdateSupplierContactInfo] fail,err:%+v", updateSupplierErr)
+				return nil, false, updateSupplierErr
+			}
+			contactInfo.WechatNumber = req.WechatNumber
+		}
+	}
+	return contactInfo, true, nil
+}

+ 6 - 6
service/sub_account.go

@@ -52,12 +52,12 @@ func (*subaccount) CreateSubAccount(ctx context.Context, request *http_model.Add
 }
 
 // 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
-	}
+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
 }