controller中的代码
@Controller
@RequestMapping("/brand")
public class PmsBrandController {
@Autowired
private PmsBrandService demoService;
@RequestMapping(value="/create",method=RequestMethod.POST)
@ResponseBody
public CommonResult createBrand(@RequestBody PmsBrand pmsBrand) {
CommonResult commonResult;
int count = demoService.createBrand(pmsBrand);
if(count == 1) {
commonResult = CommonResult.success(pmsBrand);
}else{
commonResult = CommonResult.failed