本文整理汇总了Java中com.zheng.cms.common.constant.CmsResult类的典型用法代码示例。如果您正苦于以下问题:Java CmsResult类的具体用法?Java CmsResult怎么用?Java CmsResult使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CmsResult类属于com.zheng.cms.common.constant包,在下文中一共展示了CmsResult类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: comment
import com.zheng.cms.common.constant.CmsResult; //导入依赖的package包/类
/**
* 新增回复
* @param articleId
* @param cmsComment
* @param request
* @return
*/
@RequestMapping(value = "/comment/{articleId}", method = RequestMethod.POST)
@ResponseBody
public Object comment(@PathVariable("articleId") int articleId, CmsComment cmsComment, HttpServletRequest request) {
// 系统id
CmsSystemExample cmsSystemExample = new CmsSystemExample();
cmsSystemExample.createCriteria()
.andCodeEqualTo(CODE);
CmsSystem system = cmsSystemService.selectFirstByExample(cmsSystemExample);
long time = System.currentTimeMillis();
cmsComment.setCtime(time);
cmsComment.setArticleId(articleId);
cmsComment.setUserId(USERID);
cmsComment.setStatus((byte) 1);
cmsComment.setIp(RequestUtil.getIpAddr(request));
cmsComment.setAgent(request.getHeader("User-Agent"));
cmsComment.setSystemId(system.getSystemId());
int count = cmsCommentService.insertSelective(cmsComment);
return new CmsResult(CmsResultConstant.SUCCESS, count);
}
示例2: answer
import com.zheng.cms.common.constant.CmsResult; //导入依赖的package包/类
/**
* 新增回复
* @param articleId
* @param cmsComment
* @param request
* @return
*/
@RequestMapping(value = "/answer/{articleId}", method = RequestMethod.POST)
@ResponseBody
public Object answer(@PathVariable("articleId") int articleId, CmsComment cmsComment, HttpServletRequest request) {
// 系统id
CmsSystemExample cmsSystemExample = new CmsSystemExample();
cmsSystemExample.createCriteria()
.andCodeEqualTo(CODE);
CmsSystem system = cmsSystemService.selectFirstByExample(cmsSystemExample);
long time = System.currentTimeMillis();
cmsComment.setCtime(time);
cmsComment.setArticleId(articleId);
cmsComment.setUserId(USERID);
cmsComment.setStatus((byte) 1);
cmsComment.setIp(RequestUtil.getIpAddr(request));
cmsComment.setAgent(request.getHeader("User-Agent"));
cmsComment.setSystemId(system.getSystemId());
int count = cmsCommentService.insertSelective(cmsComment);
return new CmsResult(CmsResultConstant.SUCCESS, count);
}
示例3: create
import com.zheng.cms.common.constant.CmsResult; //导入依赖的package包/类
@ApiOperation(value = "新增类目")
@RequiresPermissions("cms:category:create")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public Object create(CmsCategory cmsCategory) {
ComplexResult result = FluentValidator.checkAll()
.on(cmsCategory.getName(), new LengthValidator(1, 20, "名称"))
.doValidate()
.result(ResultCollectors.toComplex());
if (!result.isSuccess()) {
return new CmsResult(CmsResultConstant.INVALID_LENGTH, result.getErrors());
}
long time = System.currentTimeMillis();
cmsCategory.setCtime(time);
cmsCategory.setOrders(time);
int count = cmsCategoryService.insertSelective(cmsCategory);
return new CmsResult(CmsResultConstant.SUCCESS, count);
}
示例4: update
import com.zheng.cms.common.constant.CmsResult; //导入依赖的package包/类
@ApiOperation(value = "修改类目")
@RequiresPermissions("cms:category:update")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
public Object update(@PathVariable("id") int id, CmsCategory cmsCategory) {
ComplexResult result = FluentValidator.checkAll()
.on(cmsCategory.getName(), new LengthValidator(1, 20, "名称"))
.doValidate()
.result(ResultCollectors.toComplex());
if (!result.isSuccess()) {
return new CmsResult(CmsResultConstant.INVALID_LENGTH, result.getErrors());
}
cmsCategory.setCategoryId(id);
int count = cmsCategoryService.updateByPrimaryKeySelective(cmsCategory);
return new CmsResult(CmsResultConstant.SUCCESS, count);
}
示例5: create
import com.zheng.cms.common.constant.CmsResult; //导入依赖的package包/类
@ApiOperation(value = "新增文章")
@RequiresPermissions("cms:article:create")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public Object create(CmsArticle cmsArticle) {
ComplexResult result = FluentValidator.checkAll()
.on(cmsArticle.getTitle(), new LengthValidator(1, 200, "标题"))
.doValidate()
.result(ResultCollectors.toComplex());
if (!result.isSuccess()) {
return new CmsResult(CmsResultConstant.INVALID_LENGTH, result.getErrors());
}
long time = System.currentTimeMillis();
cmsArticle.setCtime(time);
cmsArticle.setOrders(time);
cmsArticle.setReadnumber(0);
int count = cmsArticleService.insertSelective(cmsArticle);
return new CmsResult(CmsResultConstant.SUCCESS, count);
}
示例6: update
import com.zheng.cms.common.constant.CmsResult; //导入依赖的package包/类
@ApiOperation(value = "修改文章")
@RequiresPermissions("cms:article:update")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
public Object update(@PathVariable("id") int id, CmsArticle cmsArticle) {
ComplexResult result = FluentValidator.checkAll()
.on(cmsArticle.getTitle(), new LengthValidator(1, 200, "标题"))
.doValidate()
.result(ResultCollectors.toComplex());
if (!result.isSuccess()) {
return new CmsResult(CmsResultConstant.INVALID_LENGTH, result.getErrors());
}
cmsArticle.setArticleId(id);
int count = cmsArticleService.updateByPrimaryKeySelective(cmsArticle);
return new CmsResult(CmsResultConstant.SUCCESS, count);
}
示例7: create
import com.zheng.cms.common.constant.CmsResult; //导入依赖的package包/类
@ApiOperation(value = "新增单页")
@RequiresPermissions("cms:page:create")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public Object create(CmsPage cmsPage) {
ComplexResult result = FluentValidator.checkAll()
.on(cmsPage.getTitle(), new LengthValidator(1, 20, "标题"))
.doValidate()
.result(ResultCollectors.toComplex());
if (!result.isSuccess()) {
return new CmsResult(CmsResultConstant.INVALID_LENGTH, result.getErrors());
}
long time = System.currentTimeMillis();
cmsPage.setCtime(time);
cmsPage.setOrders(time);
int count = cmsPageService.insertSelective(cmsPage);
return new CmsResult(CmsResultConstant.SUCCESS, count);
}
示例8: update
import com.zheng.cms.common.constant.CmsResult; //导入依赖的package包/类
@ApiOperation(value = "修改单页")
@RequiresPermissions("cms:page:update")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
public Object update(@PathVariable("id") int id, CmsPage cmsPage) {
ComplexResult result = FluentValidator.checkAll()
.on(cmsPage.getTitle(), new LengthValidator(1, 20, "标题"))
.doValidate()
.result(ResultCollectors.toComplex());
if (!result.isSuccess()) {
return new CmsResult(CmsResultConstant.INVALID_LENGTH, result.getErrors());
}
cmsPage.setPageId(id);
int count = cmsPageService.updateByPrimaryKeySelective(cmsPage);
return new CmsResult(CmsResultConstant.SUCCESS, count);
}
示例9: create
import com.zheng.cms.common.constant.CmsResult; //导入依赖的package包/类
@ApiOperation(value = "新增专题")
@RequiresPermissions("cms:topic:create")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public Object create(CmsTopic cmsTopic) {
ComplexResult result = FluentValidator.checkAll()
.on(cmsTopic.getTitle(), new LengthValidator(1, 100, "标题"))
.doValidate()
.result(ResultCollectors.toComplex());
if (!result.isSuccess()) {
return new CmsResult(CmsResultConstant.INVALID_LENGTH, result.getErrors());
}
long time = System.currentTimeMillis();
cmsTopic.setCtime(time);
int count = cmsTopicService.insertSelective(cmsTopic);
return new CmsResult(CmsResultConstant.SUCCESS, count);
}
示例10: update
import com.zheng.cms.common.constant.CmsResult; //导入依赖的package包/类
@ApiOperation(value = "修改专题")
@RequiresPermissions("cms:topic:update")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
public Object update(@PathVariable("id") int id, CmsTopic cmsTopic) {
ComplexResult result = FluentValidator.checkAll()
.on(cmsTopic.getTitle(), new LengthValidator(1, 100, "标题"))
.doValidate()
.result(ResultCollectors.toComplex());
if (!result.isSuccess()) {
return new CmsResult(CmsResultConstant.INVALID_LENGTH, result.getErrors());
}
cmsTopic.setTopicId(id);
int count = cmsTopicService.updateByPrimaryKeySelective(cmsTopic);
return new CmsResult(CmsResultConstant.SUCCESS, count);
}
示例11: create
import com.zheng.cms.common.constant.CmsResult; //导入依赖的package包/类
@ApiOperation(value = "新增标签")
@RequiresPermissions("cms:tag:create")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public Object create(CmsTag cmsTag) {
ComplexResult result = FluentValidator.checkAll()
.on(cmsTag.getName(), new LengthValidator(1, 20, "名称"))
.doValidate()
.result(ResultCollectors.toComplex());
if (!result.isSuccess()) {
return new CmsResult(CmsResultConstant.INVALID_LENGTH, result.getErrors());
}
long time = System.currentTimeMillis();
cmsTag.setCtime(time);
cmsTag.setOrders(time);
int count = cmsTagService.insertSelective(cmsTag);
return new CmsResult(CmsResultConstant.SUCCESS, count);
}
示例12: update
import com.zheng.cms.common.constant.CmsResult; //导入依赖的package包/类
@ApiOperation(value = "修改标签")
@RequiresPermissions("cms:tag:update")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
public Object update(@PathVariable("id") int id, CmsTag cmsTag) {
ComplexResult result = FluentValidator.checkAll()
.on(cmsTag.getName(), new LengthValidator(1, 20, "名称"))
.doValidate()
.result(ResultCollectors.toComplex());
if (!result.isSuccess()) {
return new CmsResult(CmsResultConstant.INVALID_LENGTH, result.getErrors());
}
cmsTag.setTagId(id);
int count = cmsTagService.updateByPrimaryKeySelective(cmsTag);
return new CmsResult(CmsResultConstant.SUCCESS, count);
}
示例13: update
import com.zheng.cms.common.constant.CmsResult; //导入依赖的package包/类
@ApiOperation(value = "修改设置")
@RequiresPermissions("cms:setting:update")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
public Object update(@PathVariable("id") int id, CmsSetting cmsSetting) {
ComplexResult result = FluentValidator.checkAll()
.on(cmsSetting.getSettingKey(), new LengthValidator(1, 20, "键"))
.doValidate()
.result(ResultCollectors.toComplex());
if (!result.isSuccess()) {
return new CmsResult(CmsResultConstant.INVALID_LENGTH, result.getErrors());
}
cmsSetting.setSettingId(id);
int count = cmsSettingService.updateByPrimaryKeySelective(cmsSetting);
return new CmsResult(CmsResultConstant.SUCCESS, count);
}
示例14: create
import com.zheng.cms.common.constant.CmsResult; //导入依赖的package包/类
@ApiOperation(value = "新增菜单")
@RequiresPermissions("cms:menu:create")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public Object create(CmsMenu cmsMenu) {
ComplexResult result = FluentValidator.checkAll()
.on(cmsMenu.getName(), new LengthValidator(1, 20, "名称"))
.doValidate()
.result(ResultCollectors.toComplex());
if (!result.isSuccess()) {
return new CmsResult(CmsResultConstant.INVALID_LENGTH, result.getErrors());
}
long time = System.currentTimeMillis();
cmsMenu.setOrders(time);
int count = cmsMenuService.insertSelective(cmsMenu);
return new CmsResult(CmsResultConstant.SUCCESS, count);
}
示例15: update
import com.zheng.cms.common.constant.CmsResult; //导入依赖的package包/类
@ApiOperation(value = "修改菜单")
@RequiresPermissions("cms:menu:update")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
public Object update(@PathVariable("id") int id, CmsMenu cmsMenu) {
ComplexResult result = FluentValidator.checkAll()
.on(cmsMenu.getName(), new LengthValidator(1, 20, "名称"))
.doValidate()
.result(ResultCollectors.toComplex());
if (!result.isSuccess()) {
return new CmsResult(CmsResultConstant.INVALID_LENGTH, result.getErrors());
}
cmsMenu.setMenuId(id);
int count = cmsMenuService.updateByPrimaryKeySelective(cmsMenu);
return new CmsResult(CmsResultConstant.SUCCESS, count);
}