作者 yangfu

client version fix

@@ -10,9 +10,9 @@ type CreateClientVersionRequest struct { @@ -10,9 +10,9 @@ type CreateClientVersionRequest struct {
10 // 提交人 10 // 提交人
11 //Commiter int64 `json:"commiter,omitempty"` 11 //Commiter int64 `json:"commiter,omitempty"`
12 // 项目名称 12 // 项目名称
13 - ProjectName string `json:"projectName,omitempty"` 13 + ProjectName string `json:"projectName,omitempty" valid:"Required"`
14 // 版本号 14 // 版本号
15 - Version string `json:"version,omitempty"` 15 + Version string `json:"version,omitempty" valid:"Required"`
16 // 标题 16 // 标题
17 Title string `json:"title,omitempty"` 17 Title string `json:"title,omitempty"`
18 // 其他备注信息 18 // 其他备注信息
@@ -163,11 +163,15 @@ func (svr *ClientVersionService) ListClientVersion(header *protocol.RequestHeade @@ -163,11 +163,15 @@ func (svr *ClientVersionService) ListClientVersion(header *protocol.RequestHeade
163 if total, clientVersion, err = ClientVersionRepository.Find(common.ObjectToMap(request)); err != nil { 163 if total, clientVersion, err = ClientVersionRepository.Find(common.ObjectToMap(request)); err != nil {
164 return 164 return
165 } 165 }
166 - rsp = map[string]interface{}{  
167 - "totalRow": total,  
168 - "pageNumber": (request.Offset + request.Limit) / request.Limit,  
169 - "lists": utils.LoadCustomField(clientVersion, "Id", "ProjectName", "Version", "Title", "Remark", "CreateTime"), 166 + rspData := map[string]interface{}{
  167 + "totalRow": total,
  168 + "lists": utils.LoadCustomField(clientVersion, "Id", "ProjectName", "Version", "Title", "Remark", "ClientPackageInfo", "CreateTime"),
170 } 169 }
  170 + if request.Limit > 0 {
  171 + rspData["pageNumber"] = (request.Offset + request.Limit) / request.Limit
  172 + }
  173 + rsp = rspData
  174 +
171 err = transactionContext.CommitTransaction() 175 err = transactionContext.CommitTransaction()
172 return 176 return
173 } 177 }