作者 tangxuhui

更新

package dto
import "time"
type CooperationContractItem struct {
CooperationContractId int `json:"cooperationContractId,string,"`
CooperationContractNumber string `json:"cooperationContractNumber"` //合约编号
CooperationProjectNumber string `json:"cooperationProjectNumber"`
CooperationContractName string `json:"CooperationContractName"` //合约名称
Department string `json:"department"`
IncentivesType string `json:"incentivesType"` //Incentives激励方式
CooperationContractSponsor struct {
UserId int `json:"userId,string,"`
UserName string `json:"userName"`
} `json:"cooperationContractSponsor"` //共创发起人
CooperationMode struct {
CooperationModeId int `json:"cooperationModeId,string,"` // 共创模式ID
CooperationModeNumber string `json:"cooperationModeNumber"` // 共创模式编码,
CooperationModeName string `json:"cooperationModeName"` // 模式名称,
} `json:"cooperationMode"` //共创模式
Status int `json:"status"` //合约状态
CreateTtime time.Time `json:"createTtime"`
Org struct {
OrgId int `json:"orgId"` //发部门, id
OrgName string `json:"orgName"` //发起企业
} `json:"org"` //组织结构
}
type CooperationContractInfo struct {
}
... ...
... ... @@ -21,7 +21,7 @@ func (cooperationContractService *CooperationContractService) CreateCooperationC
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
return nil, err
return createCooperationContractCommand, err
}
// 暂停恢复共创合约
... ... @@ -53,6 +53,12 @@ func (cooperationContractService *CooperationContractService) ListCooperationCon
if err := listCooperationContractQuery.ValidateQuery(); err != nil {
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(listCooperationContractQuery.Operator)
result, err := creationCooperationGateway.CooperationContractSearch(allied_creation_cooperation.ReqCooperationContractSearch{})
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
_ = result
return nil, nil
}
... ...
... ... @@ -119,6 +119,10 @@ type (
//查询共创合约
type (
ReqCooperationContractSearch struct {
// 查询偏离量
PageNumber int `json:"pageNumber"`
// 查询限制
PageSize int `json:"pageSize" valid:"Required"`
}
DataCooperationContractSearch struct {
... ... @@ -161,7 +165,7 @@ type (
//返回共创合约详情
type (
ReqCooperationContractGet struct {
CooperationContractId int
CooperationContractId int `json:"cooperationContractId"`
}
DataCooperationContractGet struct {
... ...
... ... @@ -19,23 +19,15 @@ func (controller *baseController) returnPageListData(count int64, data interface
controller.Response(dataMap, err)
}
func (controller *baseController) GetUserId() int64 {
return 1
}
func (controller *baseController) GetCompanyId() int64 {
return 1
}
func (controller *baseController) GetUserBaseId() int64 {
return 1
}
func (controller *baseController) GetOrgId() int64 {
return 1
}
func (controller *baseController) GetOperator() domain.Operator {
// tk, _ := middleware.FormCtxLoginToken(controller.Ctx)
// operator := domain.Operator{
// UserId: tk.UserId,
// CompanyId: tk.CompanyId,
// OrgId: tk.OrgId,
// UserBaseId: tk.UserBaseId,
// }
return domain.Operator{
UserId: 9,
CompanyId: 23,
... ...
package middleware
import (
"github.com/beego/beego/v2/server/web/context"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
)
type CtxKeyLoginToken struct{}
func JWTAuth(ctx *context.Context) {
tokenStr := ctx.Input.Header("xxxx")
tk := domain.LoginToken{}
err := tk.ParseToken(tokenStr)
if err != nil {
//
return
}
ctx.Input.SetData(CtxKeyLoginToken{}, domain.LoginToken{})
}
func NewCtxLoginToken(ctx *context.Context, tk domain.LoginToken) {
ctx.Input.SetData(CtxKeyLoginToken{}, domain.LoginToken{})
}
func FormCtxLoginToken(ctx *context.Context) (domain.LoginToken, bool) {
val := ctx.Input.GetData(CtxKeyLoginToken{})
if v, ok := val.(domain.LoginToken); ok {
return v, true
}
return domain.LoginToken{}, false
}
... ...