正在显示
15 个修改的文件
包含
72 行增加
和
10 行删除
| @@ -13,6 +13,10 @@ type ListContractUndertakerFeedbackQuery struct { | @@ -13,6 +13,10 @@ type ListContractUndertakerFeedbackQuery struct { | ||
| 13 | Offset int `cname:"查询偏离量" json:"offset,omitempty"` | 13 | Offset int `cname:"查询偏离量" json:"offset,omitempty"` |
| 14 | // 查询限制 | 14 | // 查询限制 |
| 15 | Limit int `cname:"查询限制" json:"limit,omitempty"` | 15 | Limit int `cname:"查询限制" json:"limit,omitempty"` |
| 16 | + // 查询偏离量 | ||
| 17 | + PageSize int32 `cname:"查询限制" json:"pageSize,omitempty"` | ||
| 18 | + // 查询限制 | ||
| 19 | + PageNumber int32 `cname:"查询限制" json:"pageNumber,omitempty"` | ||
| 16 | // 承接人uid | 20 | // 承接人uid |
| 17 | UnderTakerUid string `cname:"承接人uid" json:"underTakerUid" valid:"Required"` | 21 | UnderTakerUid string `cname:"承接人uid" json:"underTakerUid" valid:"Required"` |
| 18 | // 公司ID,通过集成REST上下文获取 | 22 | // 公司ID,通过集成REST上下文获取 |
| @@ -10,9 +10,9 @@ import ( | @@ -10,9 +10,9 @@ import ( | ||
| 10 | 10 | ||
| 11 | type SearchContractUndertakerFeedbackQuery struct { | 11 | type SearchContractUndertakerFeedbackQuery struct { |
| 12 | // 页面大小 | 12 | // 页面大小 |
| 13 | - PageNumber int32 `cname:"页面大小" json:"pageNumber" valid:"Required"` | 13 | + PageNumber int32 `cname:"页面大小" json:"pageNumber,omitempty"` |
| 14 | // 页面大小 | 14 | // 页面大小 |
| 15 | - PageSize int32 `cname:"页面大小" json:"pageSize" valid:"Required"` | 15 | + PageSize int32 `cname:"页面大小" json:"pageSize,omitempty"` |
| 16 | // 共创合约名称 | 16 | // 共创合约名称 |
| 17 | CooperationContractName string `cname:"共创合约名称" json:"cooperationContractName" valid:"Required"` | 17 | CooperationContractName string `cname:"共创合约名称" json:"cooperationContractName" valid:"Required"` |
| 18 | // 承接人姓名 | 18 | // 承接人姓名 |
| @@ -9,6 +9,10 @@ import ( | @@ -9,6 +9,10 @@ import ( | ||
| 9 | ) | 9 | ) |
| 10 | 10 | ||
| 11 | type ListCooperationApplicationQuery struct { | 11 | type ListCooperationApplicationQuery struct { |
| 12 | + // 页面大小 | ||
| 13 | + PageNumber int32 `cname:"页面大小" json:"pageNumber,omitempty"` | ||
| 14 | + // 页面大小 | ||
| 15 | + PageSize int32 `cname:"页面大小" json:"pageSize,omitempty"` | ||
| 12 | // 查询偏离量 | 16 | // 查询偏离量 |
| 13 | Offset int `cname:"查询偏离量" json:"offset" valid:"Required"` | 17 | Offset int `cname:"查询偏离量" json:"offset" valid:"Required"` |
| 14 | // 查询限制 | 18 | // 查询限制 |
| @@ -9,6 +9,10 @@ import ( | @@ -9,6 +9,10 @@ import ( | ||
| 9 | ) | 9 | ) |
| 10 | 10 | ||
| 11 | type ListCooperationContractQuery struct { | 11 | type ListCooperationContractQuery struct { |
| 12 | + // 页面大小 | ||
| 13 | + PageNumber int32 `cname:"页面大小" json:"pageNumber,omitempty"` | ||
| 14 | + // 页面大小 | ||
| 15 | + PageSize int32 `cname:"页面大小" json:"pageSize,omitempty"` | ||
| 12 | // 查询偏离量 | 16 | // 查询偏离量 |
| 13 | Offset int `cname:"查询偏离量" json:"offset" valid:"Required"` | 17 | Offset int `cname:"查询偏离量" json:"offset" valid:"Required"` |
| 14 | // 查询限制 | 18 | // 查询限制 |
| @@ -9,6 +9,10 @@ import ( | @@ -9,6 +9,10 @@ import ( | ||
| 9 | ) | 9 | ) |
| 10 | 10 | ||
| 11 | type SearchCooperationContractByUndertakerQuery struct { | 11 | type SearchCooperationContractByUndertakerQuery struct { |
| 12 | + // 页面大小 | ||
| 13 | + PageNumber int32 `cname:"页面大小" json:"pageNumber,omitempty"` | ||
| 14 | + // 页面大小 | ||
| 15 | + PageSize int32 `cname:"页面大小" json:"pageSize,omitempty"` | ||
| 12 | // 共创合约名称 | 16 | // 共创合约名称 |
| 13 | CooperationContractName string `cname:"共创合约名称" json:"cooperationContractName,omitempty"` | 17 | CooperationContractName string `cname:"共创合约名称" json:"cooperationContractName,omitempty"` |
| 14 | // 项目发起人姓名 | 18 | // 项目发起人姓名 |
| @@ -9,6 +9,10 @@ import ( | @@ -9,6 +9,10 @@ import ( | ||
| 9 | ) | 9 | ) |
| 10 | 10 | ||
| 11 | type ListCooperationContractChangeLogQuery struct { | 11 | type ListCooperationContractChangeLogQuery struct { |
| 12 | + // 页面大小 | ||
| 13 | + PageNumber int32 `cname:"页面大小" json:"pageNumber,omitempty"` | ||
| 14 | + // 页面大小 | ||
| 15 | + PageSize int32 `cname:"页面大小" json:"pageSize,omitempty"` | ||
| 12 | // 查询偏离量 | 16 | // 查询偏离量 |
| 13 | Offset int `cname:"查询偏离量" json:"offset" valid:"Required"` | 17 | Offset int `cname:"查询偏离量" json:"offset" valid:"Required"` |
| 14 | // 查询限制 | 18 | // 查询限制 |
| @@ -9,6 +9,10 @@ import ( | @@ -9,6 +9,10 @@ import ( | ||
| 9 | ) | 9 | ) |
| 10 | 10 | ||
| 11 | type ListCooperationModeQuery struct { | 11 | type ListCooperationModeQuery struct { |
| 12 | + // 页面大小 | ||
| 13 | + PageNumber int32 `cname:"页面大小" json:"pageNumber,omitempty"` | ||
| 14 | + // 页面大小 | ||
| 15 | + PageSize int32 `cname:"页面大小" json:"pageSize,omitempty"` | ||
| 12 | // 查询偏离量 | 16 | // 查询偏离量 |
| 13 | Offset int `cname:"查询偏离量" json:"offset" valid:"Required"` | 17 | Offset int `cname:"查询偏离量" json:"offset" valid:"Required"` |
| 14 | // 查询限制 | 18 | // 查询限制 |
| @@ -9,6 +9,10 @@ import ( | @@ -9,6 +9,10 @@ import ( | ||
| 9 | ) | 9 | ) |
| 10 | 10 | ||
| 11 | type ListCooperationProjectQuery struct { | 11 | type ListCooperationProjectQuery struct { |
| 12 | + // 页面大小 | ||
| 13 | + PageNumber int32 `cname:"页面大小" json:"pageNumber,omitempty"` | ||
| 14 | + // 页面大小 | ||
| 15 | + PageSize int32 `cname:"页面大小" json:"pageSize,omitempty"` | ||
| 12 | // 查询偏离量 | 16 | // 查询偏离量 |
| 13 | Offset int `cname:"查询偏离量" json:"offset" valid:"Required"` | 17 | Offset int `cname:"查询偏离量" json:"offset" valid:"Required"` |
| 14 | // 查询限制 | 18 | // 查询限制 |
| @@ -9,6 +9,10 @@ import ( | @@ -9,6 +9,10 @@ import ( | ||
| 9 | ) | 9 | ) |
| 10 | 10 | ||
| 11 | type ListCreditAccountQuery struct { | 11 | type ListCreditAccountQuery struct { |
| 12 | + // 页面大小 | ||
| 13 | + PageNumber int32 `cname:"页面大小" json:"pageNumber,omitempty"` | ||
| 14 | + // 页面大小 | ||
| 15 | + PageSize int32 `cname:"页面大小" json:"pageSize,omitempty"` | ||
| 12 | // 查询偏离量 | 16 | // 查询偏离量 |
| 13 | Offset int `cname:"查询偏离量" json:"offset" valid:"Required"` | 17 | Offset int `cname:"查询偏离量" json:"offset" valid:"Required"` |
| 14 | // 查询限制 | 18 | // 查询限制 |
| @@ -10,6 +10,10 @@ import ( | @@ -10,6 +10,10 @@ import ( | ||
| 10 | ) | 10 | ) |
| 11 | 11 | ||
| 12 | type SearchCreditAccountQuery struct { | 12 | type SearchCreditAccountQuery struct { |
| 13 | + // 页面大小 | ||
| 14 | + PageNumber int32 `cname:"页面大小" json:"pageNumber,omitempty"` | ||
| 15 | + // 页面大小 | ||
| 16 | + PageSize int32 `cname:"页面大小" json:"pageSize,omitempty"` | ||
| 13 | // 账期结算单号 | 17 | // 账期结算单号 |
| 14 | CreditAccountOrderNum string `cname:"账期结算单号" json:"creditAccountOrderNum" valid:"Required"` | 18 | CreditAccountOrderNum string `cname:"账期结算单号" json:"creditAccountOrderNum" valid:"Required"` |
| 15 | // 参与人姓名 | 19 | // 参与人姓名 |
| @@ -10,22 +10,23 @@ type HttplibUserServiceGateway struct { | @@ -10,22 +10,23 @@ type HttplibUserServiceGateway struct { | ||
| 10 | httplibBaseServiceGateway | 10 | httplibBaseServiceGateway |
| 11 | } | 11 | } |
| 12 | 12 | ||
| 13 | +// GetUser 获取用户 | ||
| 13 | func (serviceGateway *HttplibUserServiceGateway) GetUser(uid int64) (map[string]interface{}, error) { | 14 | func (serviceGateway *HttplibUserServiceGateway) GetUser(uid int64) (map[string]interface{}, error) { |
| 14 | - url := strings.Join([]string{serviceGateway.baseURL, ""}, "/") | ||
| 15 | - request := serviceGateway.createRequest(url, "post") | 15 | + url := strings.Join([]string{serviceGateway.baseURL, "users/get-user"}, "/") |
| 16 | + request := serviceGateway.createRequest(url, "get") | ||
| 16 | options := make(map[string]interface{}) | 17 | options := make(map[string]interface{}) |
| 17 | options["uid"] = uid | 18 | options["uid"] = uid |
| 18 | request.JSONBody(options) | 19 | request.JSONBody(options) |
| 19 | response := make(map[string]interface{}) | 20 | response := make(map[string]interface{}) |
| 20 | request.ToJSON(&response) | 21 | request.ToJSON(&response) |
| 21 | data, err := serviceGateway.responseHandle(response) | 22 | data, err := serviceGateway.responseHandle(response) |
| 22 | - | ||
| 23 | return data, err | 23 | return data, err |
| 24 | } | 24 | } |
| 25 | 25 | ||
| 26 | +// GetCompany 获取公司 | ||
| 26 | func (serviceGateway *HttplibUserServiceGateway) GetCompany(companyId int64) (map[string]interface{}, error) { | 27 | func (serviceGateway *HttplibUserServiceGateway) GetCompany(companyId int64) (map[string]interface{}, error) { |
| 27 | - url := strings.Join([]string{serviceGateway.baseURL, ""}, "/") | ||
| 28 | - request := serviceGateway.createRequest(url, "post") | 28 | + url := strings.Join([]string{serviceGateway.baseURL, "companies/ge-company"}, "/") |
| 29 | + request := serviceGateway.createRequest(url, "get") | ||
| 29 | options := make(map[string]interface{}) | 30 | options := make(map[string]interface{}) |
| 30 | options["companyId"] = companyId | 31 | options["companyId"] = companyId |
| 31 | request.JSONBody(options) | 32 | request.JSONBody(options) |
| @@ -35,9 +36,10 @@ func (serviceGateway *HttplibUserServiceGateway) GetCompany(companyId int64) (ma | @@ -35,9 +36,10 @@ func (serviceGateway *HttplibUserServiceGateway) GetCompany(companyId int64) (ma | ||
| 35 | return data, err | 36 | return data, err |
| 36 | } | 37 | } |
| 37 | 38 | ||
| 39 | +// GetOrganization 获取组织信息 | ||
| 38 | func (serviceGateway *HttplibUserServiceGateway) GetOrganization(organizationId int64) (map[string]interface{}, error) { | 40 | func (serviceGateway *HttplibUserServiceGateway) GetOrganization(organizationId int64) (map[string]interface{}, error) { |
| 39 | - url := strings.Join([]string{serviceGateway.baseURL, ""}, "/") | ||
| 40 | - request := serviceGateway.createRequest(url, "post") | 41 | + url := strings.Join([]string{serviceGateway.baseURL, "orgs/get-org"}, "/") |
| 42 | + request := serviceGateway.createRequest(url, "get") | ||
| 41 | options := make(map[string]interface{}) | 43 | options := make(map[string]interface{}) |
| 42 | options["orgId"] = organizationId | 44 | options["orgId"] = organizationId |
| 43 | request.JSONBody(options) | 45 | request.JSONBody(options) |
| @@ -47,6 +49,19 @@ func (serviceGateway *HttplibUserServiceGateway) GetOrganization(organizationId | @@ -47,6 +49,19 @@ func (serviceGateway *HttplibUserServiceGateway) GetOrganization(organizationId | ||
| 47 | return data, err | 49 | return data, err |
| 48 | } | 50 | } |
| 49 | 51 | ||
| 52 | +// UserInMenu 获取用户菜单模块权限 | ||
| 53 | +func (serviceGateway *HttplibUserServiceGateway) UserInMenu(menuCode string) (map[string]interface{}, error) { | ||
| 54 | + url := strings.Join([]string{serviceGateway.baseURL, "users/menu"}, "/") | ||
| 55 | + request := serviceGateway.createRequest(url, "get") | ||
| 56 | + options := make(map[string]interface{}) | ||
| 57 | + options["code"] = menuCode | ||
| 58 | + request.JSONBody(options) | ||
| 59 | + response := make(map[string]interface{}) | ||
| 60 | + request.ToJSON(&response) | ||
| 61 | + data, err := serviceGateway.responseHandle(response) | ||
| 62 | + return data, err | ||
| 63 | +} | ||
| 64 | + | ||
| 50 | func NewHttplibUserServiceGateway() *HttplibUserServiceGateway { | 65 | func NewHttplibUserServiceGateway() *HttplibUserServiceGateway { |
| 51 | return &HttplibUserServiceGateway{ | 66 | return &HttplibUserServiceGateway{ |
| 52 | httplibBaseServiceGateway: httplibBaseServiceGateway{ | 67 | httplibBaseServiceGateway: httplibBaseServiceGateway{ |
| 1 | -package translator |
pkg/infrastructure/services/user_adaptor.go
0 → 100644
-
请 注册 或 登录 后发表评论