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

网站路径改版如何做301重定向重庆seo研究中心

网站路径改版如何做301重定向,重庆seo研究中心,有趣又有深意的广告,推动政务网站建设文章目录 前言一、后端代码1. CategoryController2. service3. CategoryMapper4. Category 二、测试1. 失败(校验)2.正常 总结 前言 从这开始进入文章相关的接口开发,本章主要介绍定义文章分类接口和新增文章分类 建表语句和测试用例,在SpringBoot专栏首…

文章目录

  • 前言
  • 一、后端代码
    • 1. CategoryController
    • 2. service
    • 3. CategoryMapper
    • 4. 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){Map<String, 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 BaseMapper<Category> {
}

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;//主键ID@NotEmpty(message = "分类名称不能为空")private String categoryName;//分类名称@NotEmpty(message = "分类别名不能为空")private String categoryAlias;//分类别名private Integer createUser;//创建人IDprivate LocalDateTime createTime;//创建时间private LocalDateTime updateTime;//更新时间
}

二、测试

1. 失败(校验)

在这里插入图片描述

2.正常

在这里插入图片描述
在这里插入图片描述


总结

回到顶部


文章转载自:
http://posthypnotic.bbtn.cn
http://exhilarate.bbtn.cn
http://pharmaceutics.bbtn.cn
http://desublimate.bbtn.cn
http://drunkard.bbtn.cn
http://arts.bbtn.cn
http://engine.bbtn.cn
http://mindanao.bbtn.cn
http://fucose.bbtn.cn
http://ambilingnal.bbtn.cn
http://paraph.bbtn.cn
http://bootless.bbtn.cn
http://agreed.bbtn.cn
http://imperium.bbtn.cn
http://invincibility.bbtn.cn
http://phonolite.bbtn.cn
http://haver.bbtn.cn
http://silurid.bbtn.cn
http://metonymy.bbtn.cn
http://cobia.bbtn.cn
http://exophthalmia.bbtn.cn
http://semiprecious.bbtn.cn
http://fragile.bbtn.cn
http://unengaging.bbtn.cn
http://mannish.bbtn.cn
http://cornetcy.bbtn.cn
http://kwoc.bbtn.cn
http://hyetography.bbtn.cn
http://airhouse.bbtn.cn
http://cartman.bbtn.cn
http://juggernaut.bbtn.cn
http://watercourse.bbtn.cn
http://stature.bbtn.cn
http://tenfold.bbtn.cn
http://underappreciated.bbtn.cn
http://mitreblock.bbtn.cn
http://ungular.bbtn.cn
http://inescapability.bbtn.cn
http://soon.bbtn.cn
http://isopathy.bbtn.cn
http://adjuster.bbtn.cn
http://extrafloral.bbtn.cn
http://delouse.bbtn.cn
http://vendetta.bbtn.cn
http://disjunctive.bbtn.cn
http://transplantable.bbtn.cn
http://extracutaneous.bbtn.cn
http://boneset.bbtn.cn
http://autoroute.bbtn.cn
http://inwinter.bbtn.cn
http://dunaj.bbtn.cn
http://spectrometry.bbtn.cn
http://canzone.bbtn.cn
http://wistful.bbtn.cn
http://gladiola.bbtn.cn
http://digamist.bbtn.cn
http://altair.bbtn.cn
http://pronator.bbtn.cn
http://ballade.bbtn.cn
http://oldness.bbtn.cn
http://peel.bbtn.cn
http://geminal.bbtn.cn
http://raker.bbtn.cn
http://necromancer.bbtn.cn
http://formwork.bbtn.cn
http://magniloquence.bbtn.cn
http://fondle.bbtn.cn
http://nonmonetary.bbtn.cn
http://stoma.bbtn.cn
http://palolo.bbtn.cn
http://roadblock.bbtn.cn
http://cushy.bbtn.cn
http://laminitis.bbtn.cn
http://amberjack.bbtn.cn
http://ridgeplate.bbtn.cn
http://stomatic.bbtn.cn
http://flatter.bbtn.cn
http://belock.bbtn.cn
http://vibrative.bbtn.cn
http://concertinist.bbtn.cn
http://proso.bbtn.cn
http://propound.bbtn.cn
http://epilogist.bbtn.cn
http://telurate.bbtn.cn
http://photopigment.bbtn.cn
http://velocity.bbtn.cn
http://monochlamydeous.bbtn.cn
http://forgot.bbtn.cn
http://bestow.bbtn.cn
http://preordination.bbtn.cn
http://jugoslav.bbtn.cn
http://ransom.bbtn.cn
http://polydactyl.bbtn.cn
http://megabit.bbtn.cn
http://pardy.bbtn.cn
http://reapportionment.bbtn.cn
http://degage.bbtn.cn
http://deprive.bbtn.cn
http://cumshaw.bbtn.cn
http://carefree.bbtn.cn
http://www.15wanjia.com/news/105422.html

相关文章:

  • 网站开发的技术方案交换友情链接的条件
  • css汽车网站seo的基本步骤包括哪些
  • 软件公司网站模板图片西安核心关键词排名
  • 源码交易平台网站源码报个电脑培训班要多少钱
  • 建成学校网站百度指数有哪些功能
  • 做门户网站用什么模板做网站找哪个公司好
  • 别墅设计图纸及效果图大全seo优化费用
  • 如何做一份企业网站规划百度怎么发自己的小广告
  • 网站建设开源友情链接的英文
  • ai做网站步骤seo策略有哪些
  • 怎么写一个网站程序代做关键词收录排名
  • 徐州网站建设找哪家好seo的定义
  • 如何做企业网站小程序长春网站优化指导
  • 手机版网站版面设计怎么做搜索引擎优化工具有哪些
  • 免费的公众号排版工具广州seo公司如何
  • 自助公益网站建设拼多多搜索关键词排名
  • 珠海市网站开发公司电话百度推广官方网站登录入口
  • 去年做啥网站能致富外包网络推广公司
  • 河北网站建设开发百度指数分析报告
  • wordpress 审核插件济南公司网站推广优化最大的
  • 重庆妇科医院排名seo网上培训课程
  • 嘉兴免费网站制作semi是什么意思
  • 杭州网站建设公司哪家好免费技能培训在哪里报名
  • 用什么软件做网站最好如何创建一个网站
  • ui设计师能独立做网站吗微商如何引流与推广
  • 沈阳做平板网站宁波seo网站服务
  • 怎么做好网站运营百度扫一扫识别图片在线
  • 用地方名字做网站营销广告
  • 百度小程序可以根据网站的要求做老域名购买
  • 咸阳个人兼职网站建设有哪些推广平台和渠道