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.
34 lines
990 B
34 lines
990 B
package org.pqh.controller;
|
|
|
|
import org.apache.logging.log4j.LogManager;
|
|
import org.apache.logging.log4j.Logger;
|
|
import org.pqh.model.AbstractModel;
|
|
import org.pqh.service.BaseService;
|
|
import org.pqh.util.DBAction;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
/**
|
|
* Created by reborn on 2017/9/14.
|
|
*/
|
|
@Controller
|
|
public class BaseController<T extends AbstractModel> {
|
|
|
|
protected Logger log= LogManager.getLogger();
|
|
|
|
@Resource
|
|
protected BaseService<T> baseService;
|
|
|
|
@ResponseBody
|
|
@RequestMapping(value = "{action}",produces = "text/html;charset=UTF-8")
|
|
public String curd(@PathVariable DBAction action,T model) {
|
|
log.info(model.tableNote()+"进行"+action+"操作请求");
|
|
return baseService.curd(action, model);
|
|
}
|
|
|
|
|
|
}
|
|
|