Springboot开发学习记录(七)


一、httpservletrequest 写成httpservlet出现bug

会出现提示“Request processing failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [javax.servlet.http.HttpServlet]: Is it an abstract class?”
将原来写错的部分改为HttpServletrequest就行

package com.server.service;

import com.server.pojo.Admin;
import com.baomidou.mybatisplus.extension.service.IService;
import com.server.pojo.ResBean;

import javax.servlet.http.HttpServletRequest;


public interface IAdminService extends IService<Admin> {
    /**
     * 登录之后返回token
     * @param username
     * @param password
     * @param request
     * @return
     */

    ResBean login(String username, String password, HttpServletRequest request);

    /**
     * 根据用户名获取用户
     * @param username
     * @return
     */
    Admin getAdminByUserName(String username);
}

二、Swagger接口文档测试思路

1)登录,拿到token
2)在swagger Authorize里边加上相应参数 tokenHead token
3)保存完之后访问接口都会携带这个令牌

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值