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

渭南做网站价格市场营销四大基本内容

渭南做网站价格,市场营销四大基本内容,网络营销渠道策略研究,营销方式文章目录 前言一、后端代码1. CategoryController2. service3. CategoryMapper4. Category 二、测试1. 失败(校验)2.正常 总结 前言 从这开始进入文章相关的接口开发#xff0c;本章主要介绍定义文章分类接口和新增文章分类 建表语句和测试用例#xff0c;在SpringBoot专栏首… 文章目录 前言一、后端代码1. CategoryController2. service3. CategoryMapper4. Category 二、测试1. 失败(校验)2.正常 总结 前言 从这开始进入文章相关的接口开发本章主要介绍定义文章分类接口和新增文章分类 建表语句和测试用例在SpringBoot专栏首页此处只涉及后端代码。 一、后端代码 1. CategoryController package org.example.springboot3.bigevent.controller;import org.example.springboot3.bigevent.entity.Category; import org.example.springboot3.bigevent.entity.Result; import org.example.springboot3.bigevent.service.CategoryService; import org.example.springboot3.bigevent.utils.ThreadLocalUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import java.util.Map;/*** Create by zjg on 2024/5/26*/ RestController public class CategoryController {AutowiredCategoryService categoryService;PostMapping(/category)public Result add(RequestBody Validated Category category){MapString, Object claims ThreadLocalUtil.get();Integer userId (Integer) claims.get(userId);category.setCreateUser(userId);int i categoryService.add(category);if(i!1){return Result.error(新增文章分类失败,请稍后重试!);}return Result.success(新增文章分类成功);} } 2. service package org.example.springboot3.bigevent.service;import org.example.springboot3.bigevent.entity.Category;/*** Create by zjg on 2024/5/26*/ public interface CategoryService {public int add(Category category); } package org.example.springboot3.bigevent.service;import org.example.springboot3.bigevent.entity.Category; import org.example.springboot3.bigevent.mapper.CategoryMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.time.LocalDateTime;/*** Create by zjg on 2024/5/26*/ Service public class CategoryServiceImpl implements CategoryService{AutowiredCategoryMapper categoryMapper;Overridepublic int add(Category category) {category.setCreateTime(LocalDateTime.now());category.setUpdateTime(LocalDateTime.now());return categoryMapper.insert(category);} } 3. CategoryMapper package org.example.springboot3.bigevent.mapper;import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; import org.example.springboot3.bigevent.entity.Category;/*** Create by zjg on 2024/5/26*/ Mapper public interface CategoryMapper extends BaseMapperCategory { } 4. Category package org.example.springboot3.bigevent.entity;import jakarta.validation.constraints.NotEmpty; import lombok.Getter; import lombok.Setter; import lombok.ToString; import java.time.LocalDateTime;Getter Setter ToString public class Category {TableId(type IdType.AUTO)private Integer id;//主键IDNotEmpty(message 分类名称不能为空)private String categoryName;//分类名称NotEmpty(message 分类别名不能为空)private String categoryAlias;//分类别名private Integer createUser;//创建人IDprivate LocalDateTime createTime;//创建时间private LocalDateTime updateTime;//更新时间 } 二、测试 1. 失败(校验) 2.正常 总结 回到顶部
http://www.hkea.cn/news/14362688/

相关文章:

  • 网站优化软件有哪些聊城做网站费用信息
  • 百度竞价教程重庆网站建设推广优化
  • 长春网长春网络推广站排名中国铁路人才招聘网
  • 重庆怎么在网站上做广告商丘网站建设的公司哪家好
  • 黄冈免费网站建设平台如何做一个网页
  • 织梦网站排版能调整吗音乐网站前端模板
  • 怎么查出这个网站是谁做的建站软件
  • 安陆做网站公司长沙网站搜索引擎优化
  • 唐山市里做网站的有哪些网站建设公司
  • 黑河网站建设公司wordpress删除媒体库
  • 自己的网站怎样做优化谷歌优化网站链接怎么做
  • 徐州专门做网站做网站用vue吗
  • 响应式网站跟自适应网站的区别黑马it培训班出来现状
  • 网站开发招标公告陕西锦宇建设有限公司网站
  • 石排仿做网站邢台123最新求职招聘信息
  • 申请好域名后怎么建设网站网站后台素材
  • 哈尔滨网页设计网站模板网站模板 源码之家
  • 网站建设哪儿济南兴田德润什么活动网站建设公司模版
  • 1核1g服务器做网站江山市建设局网站
  • 北京seo排名优化网站拼多多怎么申请开店
  • 黄冈智能网站建设平台手机下载视频网站模板下载失败
  • 怎么查看一个网站是不是伪静态小说网站开发的目的
  • 沈阳餐饮网站建设html网站编辑器
  • 深圳企业建网站云服务器优惠活动
  • 国外做外贸哪个网站好些上海建筑公司名称大全
  • 生活家装饰官方网站惠州网站网站建设
  • 好用的在线地图网站小程序开发制作官网
  • 绿化信息网站建设河南省交通基本建设质量检测监督站网站
  • 免费企业网站模板源码如何快速网站备案
  • 建个企业网站要多少钱微信开发者工具文档