You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

95 lines
2.9 KiB

package #(packageName).controller;
import com.alibaba.fastjson.JSONObject;
import com.dsideal.baseSystem.Basecontroller.BaseController;
import com.dsideal.baseSystem.Interceptor.EmptyInterface;
import com.dsideal.baseSystem.Interceptor.IsLoginInterface;
import com.dsideal.baseSystem.Interceptor.IsNumericInterface;
import com.dsideal.baseSystem.LogAction.model.LogActionModel;
import com.dsideal.baseSystem.Swagger.annotation.ActionApi;
import com.dsideal.baseSystem.Swagger.annotation.Api;
import com.dsideal.baseSystem.Swagger.annotation.Param;
import com.dsideal.baseSystem.Swagger.annotation.Params;
import com.dsideal.baseSystem.Util.CommonUtil;
import com.jfinal.aop.Before;
import com.jfinal.ext.interceptor.GET;
import com.jfinal.plugin.activerecord.Page;
/**
* 作者:#(Author)
* 时间:#(CurrentTime)
*/
public class #(ClassName)Controller extends BaseController {
//实例化model
#(ClassName)Model #(FirstLowClassName)Model=new #(ClassName)Model();
/**
* 功能:增加#(ClassMemo)
* 作者:#(Author)
* 时间:#(CurrentTime)
* @return
*/
public void add#(ClassName)(#(add_Params))
{
int id=#(FirstLowClassName)Model.add#(ClassName)(#(add_Params_formodel));
JSONObject jo=new JSONObject();
jo.put("success",true);
jo.put("id",id);
jo.put("message","保存成功!");
renderJson(jo);
return;
}
/**
* 功能:更新#(ClassMemo)
* 作者:#(Author)
* 时间:#(CurrentTime)
* @return
*/
public void update#(ClassName)(#(update_Params))
{
#(FirstLowClassName)Model.update#(ClassName)(#(update_Params_formodel));
JSONObject jo=new JSONObject();
jo.put("success",true);
jo.put("message","保存成功!");
renderJson(jo);
return;
}
/**
* 功能:删除#(ClassMemo)
* 作者:#(Author)
* 时间:#(CurrentTime)
* @return
*/
public void delete#(ClassName)ById(#(delete_Params))
{
#(FirstLowClassName)Model.delete#(ClassName)ById(#(delete_Params_formodel));
JSONObject jo=new JSONObject();
jo.put("success",true);
jo.put("message","保存成功!");
renderJson(jo);
return;
}
/**
* 功能:获取#(ClassMemo)列表
* 作者:#(Author)
* 时间:#(CurrentTime)
* @return
*/
public void get#(ClassName)Page(int page,int limit) {
Page<Record> pageRecord = #(FirstLowClassName)Model.get#(ClassName)Page(page,limit);
renderJson(CommonUtil.renderJsonForLayUI(pageRecord));
return;
}
/**
* 功能:获取#(ClassMemo)某一条记录信息
* 作者:#(Author)
* 时间:#(CurrentTime)
* @return
*/
public void get#(ClassName)ById(#(delete_Params) {
Record record=#(FirstLowClassName)Model.get#(ClassName)ById(delete_Params);
renderJson(record);
return;
}
}