Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
github.com/mindyu/blog_system
基于Go语言的个人博客系统
前端使用Vue+ElementUI框架及组件
后端使用 Gin+Gorm 框架实现 RESTful 风格的微服务
博客首页美化、添加标签(分类)、添加归档、添加热门、评论排序
评论回复管理
文件上传、下载
系统日志
权限控制
关注管理(单向)好友管理(双向)
私信管理
后台首页统计功能
博客前端搜索自动补全(todo: 热门搜索关键字推荐)
系统日志导出CSV
Redis 缓存搜索数据(todo:调优)
保存草稿,采用localStorage进行本地存储
好友消息推送功能、WebSocket
Ngnix 反向代理和负载均衡、分布式部署
form 表单提交用户名和密码信息
http://localhost:8081/user/login
http://localhost:8081/user/query?id=3
http://localhost:8081/user/edit?id=20
{
"username": "chen",
"nickname":"chen",
"password": "123456",
"avatar": "/1148527767.jpg",
"sign":"生活不止眼前的苟且,还有诗和远方",
}
http://localhost:8081/user/delete?id=19
http://localhost:8081/user/add
{
"username": "qiang",
"nickname": "qiang",
"password": "123456",
"avatar": "http://localhost:8081/1148527767.jpg",
"phone":"1234658",
"email": "15465656565@qq.com",
"birthday": "2010-02-02",
"education": "本科",
}
var params = {
'data':{
'user_name': localStorage.getItem('ms_username'),
'friend_name': this.friendName
}
} // https://blog.csdn.net/qq383366204/article/details/80268007
// 实现它的json序列化方法
func (this Log) MarshalJSON() ([]byte, error) {
// 定义一个该结构体的别名
type AliasCom Log
// 定义一个新的结构体
tmp := struct {
AliasCom
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}{
AliasCom: (AliasCom)(this),
CreatedAt: this.CreatedAt.Format("2006-01-02 15:04:05"),
UpdatedAt: this.UpdatedAt.Format("2006-01-02 15:04:05"),
}
return json.Marshal(tmp)
}
// 前缀树
type Trie struct {
next map[rune]*Trie
isEnd bool
}
func NewTrie() *Trie {
root := new(Trie)
root.next = make(map[rune]*Trie)
root.isEnd = false
return root
}
func (this *Trie) Insert(word string) {
tmp := this
index := len([]rune(word)) - 1
for i, v := range []rune(word) {
if _, exist := tmp.next[v]; !exist {
node := new(Trie)
node.next = make(map[rune]*Trie)
if i == index {
node.isEnd = true
}
tmp.next[v] = node
}
tmp = tmp.next[v]
}
tmp.isEnd = true
}
func (this *Trie) Search(word string) bool {
tmp := this
for _, v := range word {
if tmp.next[v] == nil {
return false
}
tmp = tmp.next[v]
}
return tmp.isEnd
}
func (this *Trie) StartsWith(prefix string) bool {
tmp := this
for _, v := range prefix {
if tmp.next[v] == nil {
return false
}
tmp = tmp.next[v]
}
return true
}
func (this *Trie) GetStartsWith(prefix string) (result []string) {
tmp := this
if !tmp.StartsWith(prefix) {
return
}
for _, v := range prefix {
tmp = tmp.next[v]
}
result = tmp.getKey(prefix)
return
}
func (this *Trie) getKey(prefix string) (result []string) {
if this.isEnd {
result = append(result, prefix)
}
for key, val := range this.next {
result = append(result, val.getKey(fmt.Sprintf("%s%s", prefix, string(key)))...)
}
return
}
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.