本文整理汇总了Java中com.baidu.unbiz.fluentvalidator.FluentValidator类的典型用法代码示例。如果您正苦于以下问题:Java FluentValidator类的具体用法?Java FluentValidator怎么用?Java FluentValidator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FluentValidator类属于com.baidu.unbiz.fluentvalidator包,在下文中一共展示了FluentValidator类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: create
import com.baidu.unbiz.fluentvalidator.FluentValidator; //导入依赖的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);
}
开发者ID:youngMen1,项目名称:-Spring-SpringMVC-Mybatis-,代码行数:19,代码来源:CmsCategoryController.java
示例2: update
import com.baidu.unbiz.fluentvalidator.FluentValidator; //导入依赖的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);
}
开发者ID:youngMen1,项目名称:-Spring-SpringMVC-Mybatis-,代码行数:17,代码来源:CmsCategoryController.java
示例3: create
import com.baidu.unbiz.fluentvalidator.FluentValidator; //导入依赖的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);
}
开发者ID:youngMen1,项目名称:-Spring-SpringMVC-Mybatis-,代码行数:20,代码来源:CmsArticleController.java
示例4: update
import com.baidu.unbiz.fluentvalidator.FluentValidator; //导入依赖的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);
}
开发者ID:youngMen1,项目名称:-Spring-SpringMVC-Mybatis-,代码行数:17,代码来源:CmsArticleController.java
示例5: create
import com.baidu.unbiz.fluentvalidator.FluentValidator; //导入依赖的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);
}
开发者ID:youngMen1,项目名称:-Spring-SpringMVC-Mybatis-,代码行数:19,代码来源:CmsPageController.java
示例6: update
import com.baidu.unbiz.fluentvalidator.FluentValidator; //导入依赖的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);
}
开发者ID:youngMen1,项目名称:-Spring-SpringMVC-Mybatis-,代码行数:17,代码来源:CmsPageController.java
示例7: create
import com.baidu.unbiz.fluentvalidator.FluentValidator; //导入依赖的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);
}
开发者ID:youngMen1,项目名称:-Spring-SpringMVC-Mybatis-,代码行数:18,代码来源:CmsTopicController.java
示例8: update
import com.baidu.unbiz.fluentvalidator.FluentValidator; //导入依赖的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);
}
开发者ID:youngMen1,项目名称:-Spring-SpringMVC-Mybatis-,代码行数:17,代码来源:CmsTopicController.java
示例9: create
import com.baidu.unbiz.fluentvalidator.FluentValidator; //导入依赖的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);
}
开发者ID:youngMen1,项目名称:-Spring-SpringMVC-Mybatis-,代码行数:19,代码来源:CmsTagController.java
示例10: update
import com.baidu.unbiz.fluentvalidator.FluentValidator; //导入依赖的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);
}
开发者ID:youngMen1,项目名称:-Spring-SpringMVC-Mybatis-,代码行数:17,代码来源:CmsTagController.java
示例11: update
import com.baidu.unbiz.fluentvalidator.FluentValidator; //导入依赖的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);
}
开发者ID:youngMen1,项目名称:-Spring-SpringMVC-Mybatis-,代码行数:17,代码来源:CmsSettingController.java
示例12: create
import com.baidu.unbiz.fluentvalidator.FluentValidator; //导入依赖的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);
}
开发者ID:youngMen1,项目名称:-Spring-SpringMVC-Mybatis-,代码行数:18,代码来源:CmsMenuController.java
示例13: update
import com.baidu.unbiz.fluentvalidator.FluentValidator; //导入依赖的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);
}
开发者ID:youngMen1,项目名称:-Spring-SpringMVC-Mybatis-,代码行数:17,代码来源:CmsMenuController.java
示例14: create
import com.baidu.unbiz.fluentvalidator.FluentValidator; //导入依赖的package包/类
@ApiOperation(value = "新增角色")
@RequiresPermissions("upms:role:create")
@ResponseBody
@RequestMapping(value = "/create", method = RequestMethod.POST)
public Object create(UpmsRole upmsRole) {
ComplexResult result = FluentValidator.checkAll()
.on(upmsRole.getName(), new LengthValidator(1, 20, "名称"))
.on(upmsRole.getTitle(), new LengthValidator(1, 20, "标题"))
.doValidate()
.result(ResultCollectors.toComplex());
if (!result.isSuccess()) {
return new UpmsResult(UpmsResultConstant.INVALID_LENGTH, result.getErrors());
}
long time = System.currentTimeMillis();
upmsRole.setCtime(time);
upmsRole.setOrders(time);
int count = upmsRoleService.insertSelective(upmsRole);
return new UpmsResult(UpmsResultConstant.SUCCESS, count);
}
开发者ID:youngMen1,项目名称:-Spring-SpringMVC-Mybatis-,代码行数:20,代码来源:UpmsRoleController.java
示例15: update
import com.baidu.unbiz.fluentvalidator.FluentValidator; //导入依赖的package包/类
@ApiOperation(value = "修改角色")
@RequiresPermissions("upms:role:update")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
public Object update(@PathVariable("id") int id, UpmsRole upmsRole) {
ComplexResult result = FluentValidator.checkAll()
.on(upmsRole.getName(), new LengthValidator(1, 20, "名称"))
.on(upmsRole.getTitle(), new LengthValidator(1, 20, "标题"))
.doValidate()
.result(ResultCollectors.toComplex());
if (!result.isSuccess()) {
return new UpmsResult(UpmsResultConstant.INVALID_LENGTH, result.getErrors());
}
upmsRole.setRoleId(id);
int count = upmsRoleService.updateByPrimaryKeySelective(upmsRole);
return new UpmsResult(UpmsResultConstant.SUCCESS, count);
}
开发者ID:youngMen1,项目名称:-Spring-SpringMVC-Mybatis-,代码行数:18,代码来源:UpmsRoleController.java
示例16: create
import com.baidu.unbiz.fluentvalidator.FluentValidator; //导入依赖的package包/类
@ApiOperation(value = "新增用户")
@RequiresPermissions("upms:user:create")
@ResponseBody
@RequestMapping(value = "/create", method = RequestMethod.POST)
public Object create(UpmsUser upmsUser) {
ComplexResult result = FluentValidator.checkAll()
.on(upmsUser.getUsername(), new LengthValidator(1, 20, "帐号"))
.on(upmsUser.getPassword(), new LengthValidator(5, 32, "密码"))
.on(upmsUser.getRealname(), new NotNullValidator("姓名"))
.doValidate()
.result(ResultCollectors.toComplex());
if (!result.isSuccess()) {
return new UpmsResult(UpmsResultConstant.INVALID_LENGTH, result.getErrors());
}
long time = System.currentTimeMillis();
String salt = UUID.randomUUID().toString().replaceAll("-", "");
upmsUser.setSalt(salt);
upmsUser.setPassword(MD5Util.MD5(upmsUser.getPassword() + upmsUser.getSalt()));
upmsUser.setCtime(time);
upmsUser = upmsUserService.createUser(upmsUser);
if (null == upmsUser) {
return new UpmsResult(UpmsResultConstant.FAILED, "帐号名已存在!");
}
_log.info("新增用户,主键:userId={}", upmsUser.getUserId());
return new UpmsResult(UpmsResultConstant.SUCCESS, 1);
}
开发者ID:youngMen1,项目名称:-Spring-SpringMVC-Mybatis-,代码行数:27,代码来源:UpmsUserController.java
示例17: update
import com.baidu.unbiz.fluentvalidator.FluentValidator; //导入依赖的package包/类
@ApiOperation(value = "修改用户")
@RequiresPermissions("upms:user:update")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
public Object update(@PathVariable("id") int id, UpmsUser upmsUser) {
ComplexResult result = FluentValidator.checkAll()
.on(upmsUser.getUsername(), new LengthValidator(1, 20, "帐号"))
.on(upmsUser.getRealname(), new NotNullValidator("姓名"))
.doValidate()
.result(ResultCollectors.toComplex());
if (!result.isSuccess()) {
return new UpmsResult(UpmsResultConstant.INVALID_LENGTH, result.getErrors());
}
// 不允许直接改密码
upmsUser.setPassword(null);
upmsUser.setUserId(id);
int count = upmsUserService.updateByPrimaryKeySelective(upmsUser);
return new UpmsResult(UpmsResultConstant.SUCCESS, count);
}
开发者ID:youngMen1,项目名称:-Spring-SpringMVC-Mybatis-,代码行数:20,代码来源:UpmsUserController.java
示例18: create
import com.baidu.unbiz.fluentvalidator.FluentValidator; //导入依赖的package包/类
@ApiOperation(value = "新增权限")
@RequiresPermissions("upms:permission:create")
@ResponseBody
@RequestMapping(value = "/create", method = RequestMethod.POST)
public Object create(UpmsPermission upmsPermission) {
ComplexResult result = FluentValidator.checkAll()
.on(upmsPermission.getName(), new LengthValidator(1, 20, "名称"))
.doValidate()
.result(ResultCollectors.toComplex());
if (!result.isSuccess()) {
return new UpmsResult(UpmsResultConstant.INVALID_LENGTH, result.getErrors());
}
long time = System.currentTimeMillis();
upmsPermission.setCtime(time);
upmsPermission.setOrders(time);
int count = upmsPermissionService.insertSelective(upmsPermission);
return new UpmsResult(UpmsResultConstant.SUCCESS, count);
}
开发者ID:youngMen1,项目名称:-Spring-SpringMVC-Mybatis-,代码行数:19,代码来源:UpmsPermissionController.java
示例19: update
import com.baidu.unbiz.fluentvalidator.FluentValidator; //导入依赖的package包/类
@ApiOperation(value = "修改权限")
@RequiresPermissions("upms:permission:update")
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
@ResponseBody
public Object update(@PathVariable("id") int id, UpmsPermission upmsPermission) {
ComplexResult result = FluentValidator.checkAll()
.on(upmsPermission.getName(), new LengthValidator(1, 20, "名称"))
.doValidate()
.result(ResultCollectors.toComplex());
if (!result.isSuccess()) {
return new UpmsResult(UpmsResultConstant.INVALID_LENGTH, result.getErrors());
}
upmsPermission.setPermissionId(id);
int count = upmsPermissionService.updateByPrimaryKeySelective(upmsPermission);
return new UpmsResult(UpmsResultConstant.SUCCESS, count);
}
开发者ID:youngMen1,项目名称:-Spring-SpringMVC-Mybatis-,代码行数:17,代码来源:UpmsPermissionController.java
示例20: create
import com.baidu.unbiz.fluentvalidator.FluentValidator; //导入依赖的package包/类
@ApiOperation(value = "新增组织")
@RequiresPermissions("upms:organization:create")
@ResponseBody
@RequestMapping(value = "/create", method = RequestMethod.POST)
public Object create(UpmsOrganization upmsOrganization) {
ComplexResult result = FluentValidator.checkAll()
.on(upmsOrganization.getName(), new LengthValidator(1, 20, "名称"))
.doValidate()
.result(ResultCollectors.toComplex());
if (!result.isSuccess()) {
return new UpmsResult(UpmsResultConstant.INVALID_LENGTH, result.getErrors());
}
long time = System.currentTimeMillis();
upmsOrganization.setCtime(time);
int count = upmsOrganizationService.insertSelective(upmsOrganization);
return new UpmsResult(UpmsResultConstant.SUCCESS, count);
}
开发者ID:youngMen1,项目名称:-Spring-SpringMVC-Mybatis-,代码行数:18,代码来源:UpmsOrganizationController.java
注:本文中的com.baidu.unbiz.fluentvalidator.FluentValidator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论