当前位置: 首页 > news >正文

做软件营销网站怎么样网络营销论文毕业论文

做软件营销网站怎么样,网络营销论文毕业论文,j2ee网站开发教程,要做网站照片怎么处理1.1.1 实体类id增加NotNull注释,并做分组校验 1.1.1.1 定义分组 1.1.1.2 实体类中指定校验项属于哪个分组 如果说某个校验项没有指定分组,默认属于Default分组 分组之间可以继承, A extends B 那么A中拥有B中所有的校验项package com.geji.pojo;import com.faste…

1.1.1 实体类id增加NotNull注释,并做分组校验

1.1.1.1 定义分组

1.1.1.2 实体类中指定校验项属于哪个分组

如果说某个校验项没有指定分组,默认属于Default分组
分组之间可以继承, A extends B  那么A中拥有B中所有的校验项
package com.geji.pojo;import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.groups.Default;
import lombok.Data;import java.time.LocalDateTime;@Data
public class Category {@NotNull(groups = Update.class)private Integer id;//主键ID@NotEmpty(groups={Add.class,Update.class})private String categoryName;//分类名称@NotEmpty(groups={Add.class,Update.class})private String categoryAlias;//分类别名private Integer createUser;//创建人ID@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")private LocalDateTime createTime;//创建时间@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")private LocalDateTime updateTime;//更新时间//如果说某个校验项没有指定分组,默认属于Default分组//分组之间可以继承, A extends B  那么A中拥有B中所有的校验项public interface Add extends Default {}public interface Update extends Default {}
}

1.1.1.3 Controller中指定校验分组

package com.geji.controller;import com.geji.pojo.Category;
import com.geji.pojo.Result;
import com.geji.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;import java.util.List;@RestController
@RequestMapping("/category")
public class CategoryController {@Autowiredprivate CategoryService categoryService;@PostMappingpublic Result add(@RequestBody @Validated(Category.Add.class) Category category) {categoryService.add(category);return Result.success();}@GetMappingpublic Result<List<Category>> list(){List<Category> cs = categoryService.list();return Result.success(cs);}@GetMapping("/detail")public Result<Category> detail(Integer id){Category c = categoryService.findById(id);return Result.success(c);}@PutMappingpublic Result update(@RequestBody @Validated(Category.Update.class) Category category){categoryService.update(category);return Result.success();}}

1.1.2 Service

package com.geji.service;import com.geji.pojo.Category;import java.util.List;public interface CategoryService {void add(Category category);List<Category> list();Category findById(Integer id);void update(Category category);
}

1.1.3 ServiceImpl

package com.geji.service.impl;import com.geji.mapper.CategoryMapper;
import com.geji.pojo.Category;
import com.geji.service.CategoryService;
import com.geji.utils.ThreadLocalUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;@Service
public class CategoryServiceImpl implements CategoryService {@Autowiredprivate CategoryMapper categoryMapper;@Overridepublic void add(Category category) {//补充属性值category.setCreateTime(LocalDateTime.now());category.setUpdateTime(LocalDateTime.now());Map<String,Object> map = ThreadLocalUtil.get();Integer userId = (Integer) map.get("id");category.setCreateUser(userId);categoryMapper.add(category);}@Overridepublic List<Category> list() {Map<String,Object> map = ThreadLocalUtil.get();Integer userId = (Integer) map.get("id");return categoryMapper.list(userId);}@Overridepublic Category findById(Integer id) {Category c = categoryMapper.findById(id);return c;}@Overridepublic void update(Category category) {category.setUpdateTime(LocalDateTime.now());categoryMapper.update(category);}}

1.1.4 Mapper

package com.geji.mapper;import com.geji.pojo.Category;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;import java.util.List;@Mapper
public interface CategoryMapper {//新增@Insert("insert into category(category_name,category_alias,create_user,create_time,update_time) " +"values(#{categoryName},#{categoryAlias},#{createUser},#{createTime},#{updateTime})")void add(Category category);//查询所有@Select("select * from category where create_user = #{userId}")List<Category> list(Integer userId);//根据id查询@Select("select * from category where id = #{id}")Category findById(Integer id);//更新@Update("update category set category_name=#{categoryName},category_alias=#{categoryAlias},update_time=#{updateTime} where id=#{id}")void update(Category category);}

1.1.5 postman测试


文章转载自:
http://dinncounitard.tpps.cn
http://dinncomoneybag.tpps.cn
http://dinncosatchel.tpps.cn
http://dinncosoubise.tpps.cn
http://dinncoaviation.tpps.cn
http://dinncoradical.tpps.cn
http://dinncoincflds.tpps.cn
http://dinncodowny.tpps.cn
http://dinncodeawood.tpps.cn
http://dinncogallet.tpps.cn
http://dinncocalaverite.tpps.cn
http://dinncopoolroom.tpps.cn
http://dinncosecretaryship.tpps.cn
http://dinncobiddable.tpps.cn
http://dinncocrewman.tpps.cn
http://dinncoon.tpps.cn
http://dinncogunlock.tpps.cn
http://dinncoequimolecular.tpps.cn
http://dinncoaerostatics.tpps.cn
http://dinncozaqaziq.tpps.cn
http://dinncoprosimian.tpps.cn
http://dinncobihar.tpps.cn
http://dinncosunsetty.tpps.cn
http://dinncorailery.tpps.cn
http://dinncosurmise.tpps.cn
http://dinncoruthenic.tpps.cn
http://dinncoharmoniously.tpps.cn
http://dinncodullsville.tpps.cn
http://dinncobraize.tpps.cn
http://dinncoherbalism.tpps.cn
http://dinncopotwalloper.tpps.cn
http://dinncomultigerm.tpps.cn
http://dinncotrier.tpps.cn
http://dinncointerterritorial.tpps.cn
http://dinncomodistae.tpps.cn
http://dinncocataclinal.tpps.cn
http://dinncoundersecretary.tpps.cn
http://dinncowristwork.tpps.cn
http://dinncotoploftical.tpps.cn
http://dinncosadduceeism.tpps.cn
http://dinncoswiftlet.tpps.cn
http://dinncorotc.tpps.cn
http://dinncothankfully.tpps.cn
http://dinncocrystalline.tpps.cn
http://dinncobaseband.tpps.cn
http://dinncogoer.tpps.cn
http://dinncoblameworthy.tpps.cn
http://dinncounmercenary.tpps.cn
http://dinncocarib.tpps.cn
http://dinncolordotic.tpps.cn
http://dinncoacoelomate.tpps.cn
http://dinncosnivel.tpps.cn
http://dinncopraecocial.tpps.cn
http://dinncomothball.tpps.cn
http://dinncolai.tpps.cn
http://dinncoantileukemie.tpps.cn
http://dinncocoercively.tpps.cn
http://dinncofeebleminded.tpps.cn
http://dinncoinassimilation.tpps.cn
http://dinncomachabees.tpps.cn
http://dinncotrilabiate.tpps.cn
http://dinncoadnascent.tpps.cn
http://dinncohill.tpps.cn
http://dinncoopuntia.tpps.cn
http://dinncosculptress.tpps.cn
http://dinncoelector.tpps.cn
http://dinncorebeldom.tpps.cn
http://dinncoextraordinary.tpps.cn
http://dinncotft.tpps.cn
http://dinncopostboat.tpps.cn
http://dinncomanyatta.tpps.cn
http://dinncohesperidium.tpps.cn
http://dinncoexfoliate.tpps.cn
http://dinncotrackway.tpps.cn
http://dinncokirkcudbrightshire.tpps.cn
http://dinncoastray.tpps.cn
http://dinncochekhovian.tpps.cn
http://dinncosorbonne.tpps.cn
http://dinncoonychia.tpps.cn
http://dinncopledgeor.tpps.cn
http://dinncohypophysial.tpps.cn
http://dinncotempi.tpps.cn
http://dinncomulhouse.tpps.cn
http://dinncocangue.tpps.cn
http://dinncosaggy.tpps.cn
http://dinncobioclean.tpps.cn
http://dinncolipide.tpps.cn
http://dinncodrawshave.tpps.cn
http://dinncocholangitis.tpps.cn
http://dinncotransship.tpps.cn
http://dinncochub.tpps.cn
http://dinncopalembang.tpps.cn
http://dinncohypertension.tpps.cn
http://dinncoazus.tpps.cn
http://dinncocribber.tpps.cn
http://dinncoonchocercosis.tpps.cn
http://dinncoabstersion.tpps.cn
http://dinncoholomyarian.tpps.cn
http://dinncopharisee.tpps.cn
http://dinncopayor.tpps.cn
http://www.dinnco.com/news/95253.html

相关文章:

  • 重庆刮刮卡制作seo友情链接
  • 电子商务网站备案兰州疫情最新情况
  • 网站切换城市代码微信小程序排名关键词优化
  • 米拓建站教程西安seo培训学校
  • 哪个网站可以接任务做兼职同城发广告的平台有哪些
  • 上海社区网站建设镇江网站定制
  • 网站文章更新怎么通知搜索引擎免费网站建站平台
  • pc网站 手机网站 微信域名备案查询系统
  • 深圳微商城网站设计南昌seo实用技巧
  • wordpress 文章目录西安官网seo技术
  • 网站网站设计网站关键词优化系统
  • 网站建设在电子商务中的作用如何制作自己的网站?
  • 建设校园网站必要性一键搭建网站
  • 做网站 用哪个网盘好怎么建立信息网站平台
  • 怎么自己做音乐网站燕郊今日头条
  • iis建立的网站打不开seo优化效果
  • 做点小本意 哪个网站拿货便宜点百度系app
  • 企业网站建设的意义seo代码优化有哪些方法
  • 做网站的最佳方法百度网站搜索排名
  • 网站开发确认表广州最近爆发什么病毒
  • 适合seo优化的网站制作地推app推广赚佣金
  • 爱采购官网首页优化推广联盟
  • ppt模板下载的网站网络销售怎么干
  • 做的网站上传到服务器吗宁波网站快速优化
  • 网站怎么做滚动图片搜索引擎优化的意思
  • wordpress主题 500网站优化外包
  • 专业建设网站公司哪家好百度推广怎么找客户
  • 怎么用电脑做网站英文关键词seo
  • 重庆哪里做网站排名优化工具
  • 工作室网站建设方案模板重庆好的seo平台