Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Q
qk_backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
quanku
qk_backend
Commits
0abe87a3
Commit
0abe87a3
authored
Oct 12, 2023
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ai助手
parent
31cb41b2
Changes
25
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
3381 additions
and
8 deletions
+3381
-8
ch-core/src/main/java/com/wwdz/ch/core/consts/MessageEnum.java
...re/src/main/java/com/wwdz/ch/core/consts/MessageEnum.java
+3
-1
ch-dao/src/main/java/com/wwdz/ch/db/dao/AiAssistantDao.java
ch-dao/src/main/java/com/wwdz/ch/db/dao/AiAssistantDao.java
+10
-0
ch-dao/src/main/java/com/wwdz/ch/db/dao/AiDefaultQuestionDao.java
...rc/main/java/com/wwdz/ch/db/dao/AiDefaultQuestionDao.java
+17
-0
ch-dao/src/main/java/com/wwdz/ch/db/domain/AiAssistant.java
ch-dao/src/main/java/com/wwdz/ch/db/domain/AiAssistant.java
+266
-0
ch-dao/src/main/java/com/wwdz/ch/db/domain/AiAssistantExample.java
...c/main/java/com/wwdz/ch/db/domain/AiAssistantExample.java
+983
-0
ch-dao/src/main/java/com/wwdz/ch/db/domain/AiDefaultQuestion.java
...rc/main/java/com/wwdz/ch/db/domain/AiDefaultQuestion.java
+257
-0
ch-dao/src/main/java/com/wwdz/ch/db/domain/AiDefaultQuestionExample.java
.../java/com/wwdz/ch/db/domain/AiDefaultQuestionExample.java
+841
-0
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/AiAssistantRequestDto.java
...ava/com/wwdz/ch/db/dto/request/AiAssistantRequestDto.java
+23
-0
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/AiDefaultQuestionRequestDto.java
...m/wwdz/ch/db/dto/request/AiDefaultQuestionRequestDto.java
+14
-0
ch-dao/src/main/java/com/wwdz/ch/db/impl/AiAssistantDaoImpl.java
...src/main/java/com/wwdz/ch/db/impl/AiAssistantDaoImpl.java
+27
-0
ch-dao/src/main/java/com/wwdz/ch/db/impl/AiDefaultQuestionDaoImpl.java
...in/java/com/wwdz/ch/db/impl/AiDefaultQuestionDaoImpl.java
+24
-0
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/AiAssistantMapper.xml
...ain/resources/com/wwdz/ch/db/mapper/AiAssistantMapper.xml
+306
-0
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/AiDefaultQuestionMapper.xml
...sources/com/wwdz/ch/db/mapper/AiDefaultQuestionMapper.xml
+297
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/config/WebMvcConfiguration.java
.../main/java/com/wwdz/ch/wx/config/WebMvcConfiguration.java
+2
-1
ch-wx-api/src/main/java/com/wwdz/ch/wx/constant/CacheCodeConstants.java
...main/java/com/wwdz/ch/wx/constant/CacheCodeConstants.java
+7
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/AiAssistantServiceImpl.java
...main/java/com/wwdz/ch/wx/impl/AiAssistantServiceImpl.java
+21
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/AiDefaultQuestionServiceImpl.java
...ava/com/wwdz/ch/wx/impl/AiDefaultQuestionServiceImpl.java
+24
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/ItemServiceImpl.java
...pi/src/main/java/com/wwdz/ch/wx/impl/ItemServiceImpl.java
+140
-1
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/UserServiceImpl.java
...pi/src/main/java/com/wwdz/ch/wx/impl/UserServiceImpl.java
+3
-3
ch-wx-api/src/main/java/com/wwdz/ch/wx/manager/WxLoginManager.java
.../src/main/java/com/wwdz/ch/wx/manager/WxLoginManager.java
+1
-1
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/AiAssistantService.java
.../main/java/com/wwdz/ch/wx/service/AiAssistantService.java
+14
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/AiDefaultQuestionService.java
...java/com/wwdz/ch/wx/service/AiDefaultQuestionService.java
+17
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/ItemService.java
...api/src/main/java/com/wwdz/ch/wx/service/ItemService.java
+9
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/AiAssistantController.java
...c/main/java/com/wwdz/ch/wx/web/AiAssistantController.java
+53
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/WxItemController.java
...pi/src/main/java/com/wwdz/ch/wx/web/WxItemController.java
+22
-1
No files found.
ch-core/src/main/java/com/wwdz/ch/core/consts/MessageEnum.java
View file @
0abe87a3
...
...
@@ -41,6 +41,8 @@ public class MessageEnum {
SHARE
(
1
,
"分享信息"
),
COLLECT
(
2
,
"收藏信息"
),
FOLLOW
(
3
,
"关注信息"
),
AI_CHAT
(
4
,
"AI聊天信息"
),
CHAT
(
5
,
"聊天信息"
),
;
private
int
code
;
...
...
@@ -106,7 +108,7 @@ public class MessageEnum {
ITEM_SHARE
(
1
,
"分享了您的藏品"
),
ITEM_COLLECT
(
2
,
"收藏了您的藏品"
),
FAVORITES_SHARE
(
3
,
"分享了您的收藏册"
),
FAVORITES_COLLECT
(
3
,
"收藏了您的收藏册"
),
FAVORITES_COLLECT
(
4
,
"收藏了您的收藏册"
),
;
private
int
code
;
...
...
ch-dao/src/main/java/com/wwdz/ch/db/dao/AiAssistantDao.java
0 → 100644
View file @
0abe87a3
package
com.wwdz.ch.db.dao
;
import
com.wwdz.ch.db.domain.AiAssistant
;
import
com.wwdz.ch.db.dto.request.AiAssistantRequestDto
;
import
java.util.List
;
public
interface
AiAssistantDao
{
List
<
AiAssistant
>
findList
(
AiAssistantRequestDto
dto
);
}
ch-dao/src/main/java/com/wwdz/ch/db/dao/AiDefaultQuestionDao.java
0 → 100644
View file @
0abe87a3
package
com.wwdz.ch.db.dao
;
import
com.wwdz.ch.db.domain.AiDefaultQuestion
;
import
com.wwdz.ch.db.dto.request.AiDefaultQuestionRequestDto
;
import
java.util.List
;
public
interface
AiDefaultQuestionDao
{
/**
* 查询默认问题列表
* @param dto
* @return
*/
List
<
AiDefaultQuestion
>
findList
(
AiDefaultQuestionRequestDto
dto
);
}
ch-dao/src/main/java/com/wwdz/ch/db/domain/AiAssistant.java
0 → 100644
View file @
0abe87a3
package
com.wwdz.ch.db.domain
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Date
;
import
com.xxdxxs.entity.Entity
;
import
lombok.Data
;
/**
* @author shiyu
* @date 2023/10/11
*/
@Data
public
class
AiAssistant
implements
Entity
{
private
Integer
id
;
/**
* 头像
*/
private
String
avatar
;
/**
* 名称
*/
private
String
name
;
/**
* 类型
*/
private
Integer
type
;
/**
* 创建时间
*/
private
Date
createTime
;
private
static
final
long
serialVersionUID
=
1L
;
@Override
public
String
toString
()
{
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
getClass
().
getSimpleName
());
sb
.
append
(
" ["
);
sb
.
append
(
"Hash = "
).
append
(
hashCode
());
sb
.
append
(
", id="
).
append
(
id
);
sb
.
append
(
", avatar="
).
append
(
avatar
);
sb
.
append
(
", name="
).
append
(
name
);
sb
.
append
(
", type="
).
append
(
type
);
sb
.
append
(
", createTime="
).
append
(
createTime
);
sb
.
append
(
", serialVersionUID="
).
append
(
serialVersionUID
);
sb
.
append
(
"]"
);
return
sb
.
toString
();
}
@Override
public
boolean
equals
(
Object
that
)
{
if
(
this
==
that
)
{
return
true
;
}
if
(
that
==
null
)
{
return
false
;
}
if
(
getClass
()
!=
that
.
getClass
())
{
return
false
;
}
AiAssistant
other
=
(
AiAssistant
)
that
;
return
(
this
.
getId
()
==
null
?
other
.
getId
()
==
null
:
this
.
getId
().
equals
(
other
.
getId
()))
&&
(
this
.
getAvatar
()
==
null
?
other
.
getAvatar
()
==
null
:
this
.
getAvatar
().
equals
(
other
.
getAvatar
()))
&&
(
this
.
getName
()
==
null
?
other
.
getName
()
==
null
:
this
.
getName
().
equals
(
other
.
getName
()))
&&
(
this
.
getType
()
==
null
?
other
.
getType
()
==
null
:
this
.
getType
().
equals
(
other
.
getType
()))
&&
(
this
.
getCreateTime
()
==
null
?
other
.
getCreateTime
()
==
null
:
this
.
getCreateTime
().
equals
(
other
.
getCreateTime
()));
}
@Override
public
int
hashCode
()
{
final
int
prime
=
31
;
int
result
=
1
;
result
=
prime
*
result
+
((
getId
()
==
null
)
?
0
:
getId
().
hashCode
());
result
=
prime
*
result
+
((
getAvatar
()
==
null
)
?
0
:
getAvatar
().
hashCode
());
result
=
prime
*
result
+
((
getName
()
==
null
)
?
0
:
getName
().
hashCode
());
result
=
prime
*
result
+
((
getType
()
==
null
)
?
0
:
getType
().
hashCode
());
result
=
prime
*
result
+
((
getCreateTime
()
==
null
)
?
0
:
getCreateTime
().
hashCode
());
return
result
;
}
/**
* This enum was generated by MyBatis Generator.
* This enum corresponds to the database table ai_assistant
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
enum
Column
{
id
(
"id"
,
"id"
,
"INTEGER"
,
false
),
avatar
(
"avatar"
,
"avatar"
,
"VARCHAR"
,
false
),
name
(
"name"
,
"name"
,
"VARCHAR"
,
true
),
type
(
"type"
,
"type"
,
"INTEGER"
,
true
),
createTime
(
"create_time"
,
"createTime"
,
"TIMESTAMP"
,
false
);
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table ai_assistant
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private
static
final
String
BEGINNING_DELIMITER
=
"`"
;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table ai_assistant
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private
static
final
String
ENDING_DELIMITER
=
"`"
;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table ai_assistant
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private
final
String
column
;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table ai_assistant
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private
final
boolean
isColumnNameDelimited
;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table ai_assistant
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private
final
String
javaProperty
;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table ai_assistant
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private
final
String
jdbcType
;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ai_assistant
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
String
value
()
{
return
this
.
column
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ai_assistant
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
String
getValue
()
{
return
this
.
column
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ai_assistant
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
String
getJavaProperty
()
{
return
this
.
javaProperty
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ai_assistant
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
String
getJdbcType
()
{
return
this
.
jdbcType
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ai_assistant
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
Column
(
String
column
,
String
javaProperty
,
String
jdbcType
,
boolean
isColumnNameDelimited
)
{
this
.
column
=
column
;
this
.
javaProperty
=
javaProperty
;
this
.
jdbcType
=
jdbcType
;
this
.
isColumnNameDelimited
=
isColumnNameDelimited
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ai_assistant
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
String
desc
()
{
return
this
.
getEscapedColumnName
()
+
" DESC"
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ai_assistant
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
String
asc
()
{
return
this
.
getEscapedColumnName
()
+
" ASC"
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ai_assistant
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
static
Column
[]
excludes
(
Column
...
excludes
)
{
ArrayList
<
Column
>
columns
=
new
ArrayList
<>(
Arrays
.
asList
(
Column
.
values
()));
if
(
excludes
!=
null
&&
excludes
.
length
>
0
)
{
columns
.
removeAll
(
new
ArrayList
<>(
Arrays
.
asList
(
excludes
)));
}
return
columns
.
toArray
(
new
Column
[]{});
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ai_assistant
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
String
getEscapedColumnName
()
{
if
(
this
.
isColumnNameDelimited
)
{
return
new
StringBuilder
().
append
(
BEGINNING_DELIMITER
).
append
(
this
.
column
).
append
(
ENDING_DELIMITER
).
toString
();
}
else
{
return
this
.
column
;
}
}
}
}
\ No newline at end of file
ch-dao/src/main/java/com/wwdz/ch/db/domain/AiAssistantExample.java
0 → 100644
View file @
0abe87a3
This diff is collapsed.
Click to expand it.
ch-dao/src/main/java/com/wwdz/ch/db/domain/AiDefaultQuestion.java
0 → 100644
View file @
0abe87a3
package
com.wwdz.ch.db.domain
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Date
;
import
com.xxdxxs.entity.Entity
;
import
lombok.Data
;
/**
* @author shiyu
* @date 2023/10/11
*/
@Data
public
class
AiDefaultQuestion
implements
Entity
{
private
Integer
id
;
/**
* 问题
*/
private
String
question
;
/**
* 问题类型
*/
private
Integer
type
;
/**
* 创建时间
*/
private
Date
createTime
;
private
static
final
long
serialVersionUID
=
1L
;
@Override
public
String
toString
()
{
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
getClass
().
getSimpleName
());
sb
.
append
(
" ["
);
sb
.
append
(
"Hash = "
).
append
(
hashCode
());
sb
.
append
(
", id="
).
append
(
id
);
sb
.
append
(
", question="
).
append
(
question
);
sb
.
append
(
", type="
).
append
(
type
);
sb
.
append
(
", createTime="
).
append
(
createTime
);
sb
.
append
(
", serialVersionUID="
).
append
(
serialVersionUID
);
sb
.
append
(
"]"
);
return
sb
.
toString
();
}
@Override
public
boolean
equals
(
Object
that
)
{
if
(
this
==
that
)
{
return
true
;
}
if
(
that
==
null
)
{
return
false
;
}
if
(
getClass
()
!=
that
.
getClass
())
{
return
false
;
}
AiDefaultQuestion
other
=
(
AiDefaultQuestion
)
that
;
return
(
this
.
getId
()
==
null
?
other
.
getId
()
==
null
:
this
.
getId
().
equals
(
other
.
getId
()))
&&
(
this
.
getQuestion
()
==
null
?
other
.
getQuestion
()
==
null
:
this
.
getQuestion
().
equals
(
other
.
getQuestion
()))
&&
(
this
.
getType
()
==
null
?
other
.
getType
()
==
null
:
this
.
getType
().
equals
(
other
.
getType
()))
&&
(
this
.
getCreateTime
()
==
null
?
other
.
getCreateTime
()
==
null
:
this
.
getCreateTime
().
equals
(
other
.
getCreateTime
()));
}
@Override
public
int
hashCode
()
{
final
int
prime
=
31
;
int
result
=
1
;
result
=
prime
*
result
+
((
getId
()
==
null
)
?
0
:
getId
().
hashCode
());
result
=
prime
*
result
+
((
getQuestion
()
==
null
)
?
0
:
getQuestion
().
hashCode
());
result
=
prime
*
result
+
((
getType
()
==
null
)
?
0
:
getType
().
hashCode
());
result
=
prime
*
result
+
((
getCreateTime
()
==
null
)
?
0
:
getCreateTime
().
hashCode
());
return
result
;
}
/**
* This enum was generated by MyBatis Generator.
* This enum corresponds to the database table ai_default_question
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
enum
Column
{
id
(
"id"
,
"id"
,
"INTEGER"
,
false
),
question
(
"question"
,
"question"
,
"VARCHAR"
,
false
),
type
(
"type"
,
"type"
,
"INTEGER"
,
true
),
createTime
(
"create_time"
,
"createTime"
,
"TIMESTAMP"
,
false
);
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table ai_default_question
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private
static
final
String
BEGINNING_DELIMITER
=
"`"
;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table ai_default_question
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private
static
final
String
ENDING_DELIMITER
=
"`"
;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table ai_default_question
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private
final
String
column
;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table ai_default_question
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private
final
boolean
isColumnNameDelimited
;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table ai_default_question
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private
final
String
javaProperty
;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table ai_default_question
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private
final
String
jdbcType
;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ai_default_question
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
String
value
()
{
return
this
.
column
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ai_default_question
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
String
getValue
()
{
return
this
.
column
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ai_default_question
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
String
getJavaProperty
()
{
return
this
.
javaProperty
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ai_default_question
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
String
getJdbcType
()
{
return
this
.
jdbcType
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ai_default_question
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
Column
(
String
column
,
String
javaProperty
,
String
jdbcType
,
boolean
isColumnNameDelimited
)
{
this
.
column
=
column
;
this
.
javaProperty
=
javaProperty
;
this
.
jdbcType
=
jdbcType
;
this
.
isColumnNameDelimited
=
isColumnNameDelimited
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ai_default_question
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
String
desc
()
{
return
this
.
getEscapedColumnName
()
+
" DESC"
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ai_default_question
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
String
asc
()
{
return
this
.
getEscapedColumnName
()
+
" ASC"
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ai_default_question
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
static
Column
[]
excludes
(
Column
...
excludes
)
{
ArrayList
<
Column
>
columns
=
new
ArrayList
<>(
Arrays
.
asList
(
Column
.
values
()));
if
(
excludes
!=
null
&&
excludes
.
length
>
0
)
{
columns
.
removeAll
(
new
ArrayList
<>(
Arrays
.
asList
(
excludes
)));
}
return
columns
.
toArray
(
new
Column
[]{});
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ai_default_question
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
String
getEscapedColumnName
()
{
if
(
this
.
isColumnNameDelimited
)
{
return
new
StringBuilder
().
append
(
BEGINNING_DELIMITER
).
append
(
this
.
column
).
append
(
ENDING_DELIMITER
).
toString
();
}
else
{
return
this
.
column
;
}
}
}
}
\ No newline at end of file
ch-dao/src/main/java/com/wwdz/ch/db/domain/AiDefaultQuestionExample.java
0 → 100644
View file @
0abe87a3
This diff is collapsed.
Click to expand it.
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/AiAssistantRequestDto.java
0 → 100644
View file @
0abe87a3
package
com.wwdz.ch.db.dto.request
;
import
com.xxdxxs.entity.Entity
;
import
lombok.Data
;
@Data
public
class
AiAssistantRequestDto
extends
BaseRequestDto
implements
Entity
{
private
Integer
id
;
/**
* 名称
*/
private
String
name
;
/**
* 类型
*/
private
Integer
type
;
}
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/AiDefaultQuestionRequestDto.java
0 → 100644
View file @
0abe87a3
package
com.wwdz.ch.db.dto.request
;
import
com.xxdxxs.entity.Entity
;
import
lombok.Data
;
@Data
public
class
AiDefaultQuestionRequestDto
extends
BaseRequestDto
implements
Entity
{
/**
* 问题类型
*/
private
Integer
type
;
}
ch-dao/src/main/java/com/wwdz/ch/db/impl/AiAssistantDaoImpl.java
0 → 100644
View file @
0abe87a3
package
com.wwdz.ch.db.impl
;
import
com.github.pagehelper.PageHelper
;
import
com.wwdz.ch.db.dao.AiAssistantDao
;
import
com.wwdz.ch.db.domain.AiAssistant
;
import
com.wwdz.ch.db.domain.AiAssistantExample
;
import
com.wwdz.ch.db.dto.request.AiAssistantRequestDto
;
import
com.wwdz.ch.db.mapper.AiAssistantMapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
@Repository
public
class
AiAssistantDaoImpl
implements
AiAssistantDao
{
@Autowired
AiAssistantMapper
aiAssistantMapper
;
@Override
public
List
<
AiAssistant
>
findList
(
AiAssistantRequestDto
dto
)
{
AiAssistantExample
aiAssistantExample
=
new
AiAssistantExample
();
PageHelper
.
startPage
(
dto
.
getPage
(),
dto
.
getLimit
());
return
aiAssistantMapper
.
selectByExample
(
aiAssistantExample
);
}
}
ch-dao/src/main/java/com/wwdz/ch/db/impl/AiDefaultQuestionDaoImpl.java
0 → 100644
View file @
0abe87a3
package
com.wwdz.ch.db.impl
;
import
com.wwdz.ch.db.dao.AiDefaultQuestionDao
;
import
com.wwdz.ch.db.domain.AiDefaultQuestion
;
import
com.wwdz.ch.db.dto.request.AiDefaultQuestionRequestDto
;
import
com.wwdz.ch.db.mapper.AiDefaultQuestionMapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
@Repository
public
class
AiDefaultQuestionDaoImpl
implements
AiDefaultQuestionDao
{
@Autowired
AiDefaultQuestionMapper
aiDefaultQuestionMapper
;
@Override
public
List
<
AiDefaultQuestion
>
findList
(
AiDefaultQuestionRequestDto
dto
)
{
List
<
AiDefaultQuestion
>
list
=
aiDefaultQuestionMapper
.
selectRandom
(
dto
);
return
list
;
}
}
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/AiAssistantMapper.xml
0 → 100644
View file @
0abe87a3
This diff is collapsed.
Click to expand it.
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/AiDefaultQuestionMapper.xml
0 → 100644
View file @
0abe87a3
This diff is collapsed.
Click to expand it.
ch-wx-api/src/main/java/com/wwdz/ch/wx/config/WebMvcConfiguration.java
View file @
0abe87a3
...
...
@@ -38,7 +38,8 @@ public class WebMvcConfiguration implements WebMvcConfigurer {
.
addPathPatterns
(
"/**"
)
// 放行路径
.
excludePathPatterns
(
"/*.html"
,
"/**/*.html"
,
"/**/*.css"
,
"/**/*.js"
,
"/wx/user/loginByWx"
,
"/wx/user/loginByMobile"
,
"/wx/user/loginRegCaptcha"
,
"/wx/user/updateRegCaptcha"
,
"/wx/user/login"
,
"/wx/user/fillCode"
,
"/wx/user/loginByWx"
,
"/wx/user/loginByMobile"
,
"/wx/user/loginRegCaptcha"
,
"/wx/user/updateRegCaptcha"
,
"/wx/user/login"
,
"/wx/user/fillCode"
,
"/wx/item/**"
);
}
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/constant/CacheCodeConstants.java
View file @
0abe87a3
...
...
@@ -27,6 +27,13 @@ public class CacheCodeConstants {
*/
public
static
final
String
USER_INFO_KEY
=
"cjxc:wx:user:info:{0}"
;
/**
* 缓存关注者新发布藏品记录
* <p>{0}被关注者id:粉丝id</p>
*/
public
static
final
String
UNREAD_ITEM_OF_FOLLOWER_KEY
=
"cjxc:unread:{0}"
;
/**
* 短信验证码类型枚举
*/
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/AiAssistantServiceImpl.java
0 → 100644
View file @
0abe87a3
package
com.wwdz.ch.wx.impl
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.db.dao.AiAssistantDao
;
import
com.wwdz.ch.db.dto.request.AiAssistantRequestDto
;
import
com.wwdz.ch.wx.service.AiAssistantService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
@Service
public
class
AiAssistantServiceImpl
implements
AiAssistantService
{
@Autowired
AiAssistantDao
aiAssistantDao
;
@Override
public
Result
findList
(
AiAssistantRequestDto
dto
)
{
return
null
;
}
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/AiDefaultQuestionServiceImpl.java
0 → 100644
View file @
0abe87a3
package
com.wwdz.ch.wx.impl
;
import
com.wwdz.ch.db.dao.AiDefaultQuestionDao
;
import
com.wwdz.ch.db.domain.AiDefaultQuestion
;
import
com.wwdz.ch.db.dto.request.AiDefaultQuestionRequestDto
;
import
com.wwdz.ch.wx.service.AiDefaultQuestionService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
@Service
public
class
AiDefaultQuestionServiceImpl
implements
AiDefaultQuestionService
{
@Autowired
AiDefaultQuestionDao
aiDefaultQuestionDao
;
@Override
public
List
<
AiDefaultQuestion
>
findList
(
AiDefaultQuestionRequestDto
dto
)
{
List
<
AiDefaultQuestion
>
aiDefaultQuestionList
=
aiDefaultQuestionDao
.
findList
(
dto
);
return
null
;
}
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/ItemServiceImpl.java
View file @
0abe87a3
This diff is collapsed.
Click to expand it.
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/UserServiceImpl.java
View file @
0abe87a3
...
...
@@ -461,7 +461,7 @@ public class UserServiceImpl implements UserService {
user
.
setUsername
(
UUID
.
randomUUID
().
toString
().
replace
(
"-"
,
""
));
BCryptPasswordEncoder
bCryptPasswordEncoder
=
new
BCryptPasswordEncoder
();
user
.
setPassword
(
bCryptPasswordEncoder
.
encode
(
"Aa123456"
));
user
.
setWeixinOpenid
(
""
);
user
.
setWeixinOpenid
(
dto
.
getWxOpenId
()
);
user
.
setProfile
(
""
);
user
.
setBackground
(
""
);
user
.
setWechatId
(
""
);
...
...
@@ -488,10 +488,10 @@ public class UserServiceImpl implements UserService {
userDao
.
insert
(
user
);
}
else
{
// 注册过的用户修改最后登录的时间以及绑定微信openid和支付宝user_id
if
(
StringUtils
.
isNotBlank
(
dto
.
getWxOpenId
()))
{
if
(
org
.
springframework
.
util
.
StringUtils
.
hasLength
(
dto
.
getWxOpenId
()))
{
user
.
setWeixinOpenid
(
dto
.
getWxOpenId
());
}
if
(
StringUtils
.
isNotBlank
(
dto
.
getAlipayUserId
()))
{
if
(
org
.
springframework
.
util
.
StringUtils
.
hasLength
(
dto
.
getAlipayUserId
()))
{
user
.
setAlipayUserId
(
dto
.
getAlipayUserId
());
}
user
.
setLastLoginTime
(
new
Date
());
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/manager/WxLoginManager.java
View file @
0abe87a3
...
...
@@ -54,7 +54,7 @@ public class WxLoginManager {
try
{
WxMaJscode2SessionResult
result
=
this
.
wxMaService
.
getUserService
().
getSessionInfo
(
loginCode
);
openId
=
result
.
getOpenid
();
logger
.
info
(
"获取openId成功
"
);
logger
.
info
(
"获取openId成功
openId :{}"
,
openId
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"获取微信登录用户的openId失败"
,
e
);
}
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/AiAssistantService.java
0 → 100644
View file @
0abe87a3
package
com.wwdz.ch.wx.service
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.db.dto.request.AiAssistantRequestDto
;
public
interface
AiAssistantService
{
/**
* 查询ai助手列表
* @param dto
* @return
*/
Result
findList
(
AiAssistantRequestDto
dto
);
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/AiDefaultQuestionService.java
0 → 100644
View file @
0abe87a3
package
com.wwdz.ch.wx.service
;
import
com.wwdz.ch.db.domain.AiDefaultQuestion
;
import
com.wwdz.ch.db.dto.request.AiDefaultQuestionRequestDto
;
import
java.util.List
;
public
interface
AiDefaultQuestionService
{
/**
* 查询默认问题列表
* @param dto
* @return
*/
List
<
AiDefaultQuestion
>
findList
(
AiDefaultQuestionRequestDto
dto
);
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/ItemService.java
View file @
0abe87a3
...
...
@@ -143,4 +143,13 @@ public interface ItemService {
* @return
*/
Result
shareSendMessage
(
ItemRequestDto
dto
,
HttpServletRequest
request
);
/**
* 检查是否有关注者的新藏品未查看
*
* @param dto
* @return
*/
Result
checkUnreadItemOfFollower
(
ItemRequestDto
dto
);
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/AiAssistantController.java
0 → 100644
View file @
0abe87a3
package
com.wwdz.ch.wx.web
;
import
com.alibaba.fastjson.JSON
;
import
com.wwdz.ch.core.consts.ResultCode
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.db.dto.request.AiAssistantRequestDto
;
import
com.wwdz.ch.wx.service.AiAssistantService
;
import
io.swagger.annotations.ApiOperation
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
@RequestMapping
(
"/wx/aiAssistant"
)
public
class
AiAssistantController
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
AiAssistantController
.
class
);
@Autowired
AiAssistantService
aiAssistantService
;
@Autowired
AiDef
@ApiOperation
(
value
=
"查询ai助手列表"
)
@PostMapping
(
"/findList"
)
public
Result
findList
(
@RequestBody
AiAssistantRequestDto
dto
)
{
logger
.
info
(
"【请求开始】查询ai助手列表,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
if
(
dto
.
getType
()
==
null
)
{
return
Result
.
failed
(
ResultCode
.
PARAM_ERROR
);
}
return
aiAssistantService
.
findList
(
dto
);
}
@ApiOperation
(
value
=
"查询ai默认问题"
)
@PostMapping
(
"/findDefaultQuestions"
)
public
Result
findDefaultQuestions
(
@RequestBody
AiAssistantRequestDto
dto
)
{
logger
.
info
(
"【请求开始】查询ai助手列表,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
if
(
dto
.
getType
()
==
null
)
{
return
Result
.
failed
(
ResultCode
.
PARAM_ERROR
);
}
return
aiAssistantService
.
findList
(
dto
);
}
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/WxItemController.java
View file @
0abe87a3
...
...
@@ -9,6 +9,7 @@ import org.apache.commons.lang3.StringUtils;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
...
...
@@ -56,6 +57,15 @@ public class WxItemController {
@PostMapping
(
"/itemsOfFollower"
)
public
Result
itemsOfFollower
(
@RequestBody
ItemRequestDto
dto
)
{
logger
.
info
(
"【请求开始】关注人发布的商品列表,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
if
(
Objects
.
isNull
(
dto
.
getUserId
()))
{
return
Result
.
failed
(
"用户id不能为空"
);
}
if
(
Objects
.
isNull
(
dto
.
getPage
()))
{
return
Result
.
failed
(
"当前页不能为空"
);
}
if
(
Objects
.
isNull
(
dto
.
getSize
()))
{
return
Result
.
failed
(
"页面大小不能为空"
);
}
return
itemService
.
itemsOfFollower
(
dto
);
}
...
...
@@ -135,7 +145,7 @@ public class WxItemController {
return
itemService
.
update
(
dto
);
}
@ApiOperation
(
value
=
"详情"
)
@ApiOperation
(
value
=
"
藏品
详情"
)
@PostMapping
(
"/info"
)
public
Result
info
(
@RequestBody
ItemRequestDto
dto
)
{
logger
.
info
(
"【请求开始】藏品详情查询,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
...
...
@@ -240,4 +250,15 @@ public class WxItemController {
}
return
itemService
.
uploadVideo
(
file
);
}
@ApiOperation
(
value
=
"检查是否有关注者的新藏品未查看"
)
@PostMapping
(
"/checkUnreadItemOfFollower"
)
public
Result
checkUnreadItemOfFollower
(
@RequestBody
ItemRequestDto
dto
)
{
logger
.
info
(
"【请求开始】检查是否有关注者的新藏品未查看,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
if
(
ObjectUtils
.
isEmpty
(
dto
.
getUserId
()))
{
return
Result
.
failed
(
"用户id不能为空"
);
}
return
itemService
.
checkUnreadItemOfFollower
(
dto
);
}
}
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