2024.05.01

学习时间

1h

代码量 50行
博客量 1篇
学习内容
package com.example.demo22.mapper;

import com.example.demo22.entity.Article;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ArticleMapper {
//新增文章
@Insert("INSERT into article(title,content,cover_img,state,category_id,create_user,create_time,update_time)"+"values (#{title},#{content},#{coverImg},#{state},#{categoryId},#{createUser},now(),now())")
void add(Article article);
//分页查询文章
List<Article> list(Integer userId, Integer categoryId, String state);
//获取文章详情
@Select("select * from article where id = #{id}")
Article select(Integer id);
}
package com.example.demo22.service;

import com.example.demo22.entity.User;

public interface UserService {
//根据用户名查询用户
User findByUserName(String userAccount);
//注册
void register(String userAccount, String userPassword);
//更新
void update(User user);
//更新头像
void updateAvatar(String avatarUrl);
//更新密码
void updatePwd(String newPwd);
}
   
posted @   new菜鸟  阅读(12)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
历史上的今天:
2023-05-22 5.22
点击右上角即可分享
微信分享提示