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.
 
 
webcrawler/web/src/main/java/org/pqh/controller/BaseController.java

29 lines
880 B

package org.pqh.controller;
import org.pqh.core.model.AbstractModel;
import org.pqh.core.service.BaseService;
import org.pqh.core.util.DBAction;
import org.pqh.core.util.LogManger;
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.
*/
public class BaseController<T extends AbstractModel> implements LogManger{
@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.getCh() + "操作请求");
return baseService.curd(action, model);
}
}