Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
8
8timerapiv200
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
8timerv2
8timerapiv200
Commits
460d1280
Commit
460d1280
authored
Mar 09, 2022
by
龙于生
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增公司服务端地址接口和 检查账号是否存在接口
parent
42eff639
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
153 additions
and
1 deletions
+153
-1
src/main/java/cn/timer/api/bean/serverurl/CompanyServerUrl.java
+71
-0
src/main/java/cn/timer/api/config/interceptor/WebSecurityConfig.java
+2
-1
src/main/java/cn/timer/api/controller/check/CheckController.java
+52
-0
src/main/java/cn/timer/api/dao/serverurl/CompanyServerUrlMapper.java
+10
-0
src/main/resources/mapping/serverurl/CompanyServerUrlMapper.xml
+18
-0
No files found.
src/main/java/cn/timer/api/bean/serverurl/CompanyServerUrl.java
0 → 100644
View file @
460d1280
package
cn
.
timer
.
api
.
bean
.
serverurl
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.extension.activerecord.Model
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
/**
* 公司服务端地址表
*/
@Entity
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table
(
name
=
"company_server_url"
)
@Data
@ApiModel
(
"公司服务端地址表"
)
public
class
CompanyServerUrl
extends
Model
<
CompanyServerUrl
>
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* id
*/
@Id
@GeneratedValue
@TableId
(
type
=
IdType
.
AUTO
)
@ApiModelProperty
(
value
=
"ID"
)
private
Long
id
;
/**
* 公司名称
*/
@ApiModelProperty
(
value
=
"公司名称"
)
private
String
companyName
;
/**
* 服务端IP地址或域名地址
*/
@ApiModelProperty
(
value
=
"服务端IP地址或域名地址"
)
private
String
serverUrl
;
/**
* 状态 0停用 1启用
*/
@ApiModelProperty
(
value
=
"状态 0停用 1启用"
)
private
Integer
status
;
/**
* 排序 数字越大排最前面
*/
@ApiModelProperty
(
value
=
"排序 数字越大排最前面"
)
private
Integer
sort
;
/**
* 备注
*/
@ApiModelProperty
(
value
=
"备注"
)
private
String
note
;
}
src/main/java/cn/timer/api/config/interceptor/WebSecurityConfig.java
View file @
460d1280
...
@@ -49,7 +49,8 @@ public class WebSecurityConfig implements WebMvcConfigurer {
...
@@ -49,7 +49,8 @@ public class WebSecurityConfig implements WebMvcConfigurer {
.
excludePathPatterns
(
"/v2/api-docs"
)
.
excludePathPatterns
(
"/v2/api-docs"
)
.
excludePathPatterns
(
"/druid/login*"
)
.
excludePathPatterns
(
"/druid/login*"
)
.
excludePathPatterns
(
"/app/**"
)
.
excludePathPatterns
(
"/app/**"
)
.
excludePathPatterns
(
"/webjars/**"
);
.
excludePathPatterns
(
"/webjars/**"
)
.
excludePathPatterns
(
"/check/**"
);
// registry.addInterceptor(getSessionInterceptor()).addPathPatterns("/**").excludePathPatterns("/swagger-ui*");
// registry.addInterceptor(getSessionInterceptor()).addPathPatterns("/**").excludePathPatterns("/swagger-ui*");
}
}
...
...
src/main/java/cn/timer/api/controller/check/CheckController.java
0 → 100644
View file @
460d1280
package
cn
.
timer
.
api
.
controller
.
check
;
import
cn.timer.api.bean.qyzx.QyzxEmpLogin
;
import
cn.timer.api.bean.serverurl.CompanyServerUrl
;
import
cn.timer.api.utils.ResultUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.transaction.Transactional
;
import
java.util.List
;
@Api
(
tags
=
"服务器地址查询"
)
@Transactional
(
rollbackOn
=
Exception
.
class
)
@RestController
@RequestMapping
(
value
=
"/check"
,
produces
=
{
"application/json"
})
public
class
CheckController
{
@GetMapping
(
value
=
"/company_server_url_list"
)
@ApiOperation
(
value
=
"公司服务端地址列表"
,
httpMethod
=
"GET"
,
notes
=
"公司服务端地址列表"
)
public
Object
CompanyServerUrlList
(){
List
<
CompanyServerUrl
>
companyServerUrls
=
CompanyServerUrl
.
builder
().
build
()
.
selectList
(
new
QueryWrapper
<
CompanyServerUrl
>().
lambda
()
.
eq
(
CompanyServerUrl:
:
getStatus
,
1
).
orderByDesc
(
CompanyServerUrl:
:
getSort
));
//System.out.println(companyServerUrls);
return
ResultUtil
.
data
(
companyServerUrls
,
"查询成功"
);
}
@GetMapping
(
value
=
"/check_account_exist/{account}"
)
@ApiOperation
(
value
=
"检测该用户是否存在"
,
httpMethod
=
"GET"
,
notes
=
"检测该用户是否存在"
)
public
Object
checkAccountExist
(
@PathVariable
(
"account"
)
String
account
){
if
(
account
==
null
||
""
.
equals
(
account
))
{
return
ResultUtil
.
error
(
"手机号不能为空!"
);
}
List
<
QyzxEmpLogin
>
qyzxEmpLogins
=
QyzxEmpLogin
.
builder
().
build
()
.
selectList
(
new
QueryWrapper
<
QyzxEmpLogin
>()
.
lambda
().
eq
(
QyzxEmpLogin:
:
getPhone
,
account
).
eq
(
QyzxEmpLogin:
:
getSts
,
1
));
//System.out.println(qyzxEmpLogins);
if
(
qyzxEmpLogins
.
size
()==
0
){
return
ResultUtil
.
error
(
"账户不存在"
);
}
return
ResultUtil
.
success
(
"OK"
);
}
}
src/main/java/cn/timer/api/dao/serverurl/CompanyServerUrlMapper.java
0 → 100644
View file @
460d1280
package
cn
.
timer
.
api
.
dao
.
serverurl
;
import
cn.timer.api.bean.serverurl.CompanyServerUrl
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.springframework.stereotype.Repository
;
@Repository
public
interface
CompanyServerUrlMapper
extends
BaseMapper
<
CompanyServerUrl
>
{
}
src/main/resources/mapping/serverurl/CompanyServerUrlMapper.xml
0 → 100644
View file @
460d1280
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.timer.api.dao.serverurl.CompanyServerUrlMapper"
>
<!-- 可根据自己的需求,是否要使用 -->
<resultMap
type=
"cn.timer.api.bean.serverurl.CompanyServerUrl"
id=
"company"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"companyName"
column=
"company_name"
/>
<result
property=
"serverUrl"
column=
"server_url"
/>
<result
property=
"status"
column=
"status"
/>
<result
property=
"sort"
column=
"sort"
/>
<result
property=
"note"
column=
"note"
/>
</resultMap>
</mapper>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment