Commit c3755f32 by guojuxing

Merge remote-tracking branch 'origin/developer' into developer

parents 2b2d78db 17a55781
package com.gic.enterprise.constant;
public enum FieldTypeEnum {
INT("int", "int"),
STRING("string", "string"),
DATE("date", "date"),
LONG("long", "long");
private String type;
private String message;
FieldTypeEnum(String type, String message){
this.type = type;
this.message = message;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}
package com.gic.enterprise.service;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import java.util.Map;
public interface CustomSettingApiService {
/**
* save
* @Title: save
* @Description: 保存
* @author taogs
* @param tableName
* @param params
* @return com.gic.api.base.commons.ServiceResponse<java.lang.String>
* @throws
*/
ServiceResponse<String> save(String tableName, String params);
/**
* getDetail
* @Title: getDetail
* @Description: 查询详情
* @author taogs
* @param tableName
* @param searchParams
* @return com.gic.api.base.commons.ServiceResponse<java.util.Map<java.lang.String,java.lang.Object>>
* @throws
*/
ServiceResponse<Map<String, Object>> getDetail(String tableName, String searchParams);
/**
* page
* @Title: page
* @Description:
* @author taogs
* @param tableName
* @param searchParams
* @param currentPage
* @param pageSize
* @return com.gic.api.base.commons.ServiceResponse<com.gic.api.base.commons.Page<java.util.Map<java.lang.String,java.lang.Object>>>
* @throws
*/
ServiceResponse<Page<Map>> page(String tableName, String searchParams, Integer currentPage, Integer pageSize);
/**
* delete
* @Title: delete
* @Description: 删除
* @author taogs
* @param tableName
* @param id
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Integer>
* @throws
*/
ServiceResponse<Integer> delete(String tableName, String id);
}
......@@ -226,6 +226,11 @@
<artifactId>gic-member-filter-api</artifactId>
<version>${gic-member-filter-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-dubbo-extension</artifactId>
<version>4.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
......
package com.gic.operation.web.controller;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.response.EnterpriseRestResponse;
......@@ -7,13 +8,26 @@ import com.gic.enterprise.service.CustomSettingApiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.Map;
@Controller
public class CustomSettingController {
@Autowired
CustomSettingApiService customSettingApiService;
/**
* save
* @Title: save
* @Description:
* @author taogs
* @param tableName
* @param param {"enterpriseId":1166,"ttt":3}
* @return com.gic.commons.webapi.reponse.RestResponse
* @throws
*/
@RequestMapping("save")
@ResponseBody
public RestResponse save(String tableName, String param){
......@@ -23,4 +37,44 @@ public class CustomSettingController {
}
return EnterpriseRestResponse.failure(save);
}
/**
* getDetail
* @Title: getDetail
* @Description:
* @author taogs
* @param tableName
* @param searchParams {"id":1}
* @return com.gic.commons.webapi.reponse.RestResponse
* @throws
*/
@RequestMapping("get-detail")
@ResponseBody
public RestResponse getDetail(String tableName, String searchParams){
ServiceResponse<Map<String, Object>> detail = customSettingApiService.getDetail(tableName, searchParams);
if(detail.isSuccess()){
return RestResponse.success(detail.getResult());
}
return EnterpriseRestResponse.failure(detail);
}
@RequestMapping("page")
@ResponseBody
public RestResponse page(String tableName, String searchParams, @RequestParam(defaultValue = "1") Integer currentPage, @RequestParam(defaultValue = "20") Integer pageSize){
ServiceResponse<Page<Map>> page = customSettingApiService.page(tableName, searchParams, currentPage, pageSize);
if(page.isSuccess()){
return RestResponse.success(page.getResult());
}
return EnterpriseRestResponse.failure(page);
}
@RequestMapping("delete")
@ResponseBody
public RestResponse delete(String tableName, String id){
ServiceResponse<Integer> delete = customSettingApiService.delete(tableName, id);
if(delete.isSuccess()){
return RestResponse.success();
}
return EnterpriseRestResponse.failure(delete);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment