本文共 4689 字,大约阅读时间需要 15 分钟。
| 阶段 | PSP2.1 | 预估耗时(分钟) | 实际耗时(分钟) |
|---|---|---|---|
| Planning | 计划 | ||
| Estimate | 估计这个任务需要多少时间 | 10d | 11d |
| Development | 开发 | 58h 10min | 72h 10min |
| Analysis | 需求分析 (包括学习新技术) | 3h | 5h |
| Design Spec | 生成设计文档 | 1h | 1h |
| Design Review | 设计复审 | 1h | 2h |
| Coding Standard | 代码规范 (为目前的开发制定合适的规范) | 10min | 10min |
| Design | 具体设计 | 5h | 8h |
| Coding | 具体编码 | 45h | 52h |
| Code Review | 代码复审 | 1h | 1h |
| Test | 测试(自我测试,修改代码,提交修改) | 2h | 3h |
| Reporting | 报告 | 1h | 1h 10min |
| Test Report | 测试报告 | 30min | 30min |
| Size Measurement | 计算工作量 | 10min | 10min |
| Postmortem & Process Improvement Plan | 事后总结, 并提出过程改进计划 | 20min | 30min |
| 合计 | 59h 10min | 73h 20min |
| 阶段 | PSP2.1 | 预估耗时(分钟) | 实际耗时(分钟) |
|---|---|---|---|
| Planning | 计划 | 120 | 120 |
| Estimate | 估计这个任务需要多少时间 | 120 | 120 |
| Development | 开发 | 1000 | 860 |
| Analysis | 需求分析 (包括学习新技术) | 240 | 200 |
| Design Spec | 生成设计文档 | 30 | 30 |
| Design Review | 设计复审 | 20 | 20 |
| Coding Standard | 代码规范 (为目前的开发制定合适的规范) | 30 | 30 |
| Design | 具体设计 | 30 | 30 |
| Coding | 具体编码 | 500 | 400 |
| Code Review | 代码复审 | 60 | 60 |
| Test | 测试(自我测试,修改代码,提交修改) | 90 | 90 |
| Reporting | 报告 | 110 | 120 |
| Blog | 博客 | 80 | 90 |
| Postmortem & Process Improvement Plan | 事后总结, 并提出过程改进计划 | 30 | 30 |
| 合计 | 1230 | 1080 |
页面列表:
特性:
分支讨论:
main -> dev -> (frontend-dev) / (backend-dev)项目执行方案讨论:
OAuth2.0 讨论:
Model层设计:
export interface SearchModelType { namespace: ModelNameSpaces.Search; state: SearchModelState; effects: { search: Effect; }; reducers: { changePage: ImmerReducer ; changeTotal: ImmerReducer ; saveData: ImmerReducer ; saveLastSearchList: ImmerReducer ; changeCodeStatus: ImmerReducer ; };} Service层设计:
import { BASE_URL } from '@/constants';import request from 'umi-request';const login = (code: string) => { return request.get(`${BASE_URL}/login`, { params: { code } });};const logout = () => { return request.get(`${BASE_URL}/logout`);}; 目录结构图:
├── assets│ └── components│ ├── chartLoading│ ├── circleLetter│ ├── constants│ ├── editModal│ ├── iconText│ ├── lineChart│ ├── loginModal│ ├── roseChart│ ├── smallLineChart│ ├── themeSearch│ └── wordCloud├── constants├── layouts├── models└── pages ├── favorite ├── oauth2.0 ├── search └── statistic
框架使用:
架构设计:
apiV1 := r.Group("/api/v1")apiV1.GET("/auth", api.Auth)apiV1.GET("/auth-callback", api.Callback)apiV1.GET("/login", api.Login)authGroup := apiV1.Group("").Use(middleware.Auth()){ cors.Default() authGroup.GET("/logout", api.Logout) authGroup.POST("/search", api.Search) // 其他接口...}爬虫实现:
c := cron.New(cron.WithParser( cron.NewParser( cron.SecondOptional | cron.Minute | cron.Hour | cron.Dom | cron.Month | cron.Dow), ),)err := c.AddFunc("0 0 0 * * ?", func() { crawler.Start()})if err != nil { log.Println(err)}c.Start() 类型定义:
type UserModel = typeof UserInitialState;type SearchModel = typeof SearchInitialState;type FavoriteModel = typeof FavoriteInitialState;type StatisticModel = typeof StatisticInitialState;
Layout共用部分:
const { Header, Content } = ALayout;const Layout = ({ children }: IRouteComponentProps) => { const dispatch = useDispatch(); const { avatar, isLogin, username } = useSelector( (store: RootStore) => ({ const { [ModelNameSpaces.User]: UserModel } = store; return UserModel; }) ); // 组件逻辑}; 模型定义:
type Model struct { ID uint `gorm:"primarykey" json:"-"`; CreatedAt time.Time; UpdatedAt time.Time;} 路由处理:
apiV1 := r.Group("/api/v1")apiV1.GET("/auth", api.Auth)apiV1.GET("/auth-callback", api.Callback)apiV1.GET("/login", api.Login)authGroup := apiV1.Group("").Use(middleware.Auth()){ cors.Default() authGroup.GET("/logout", api.Logout) // 其他接口...} 221801107 → 221801102:
221801102 → 221801107:
转载地址:http://zfruz.baihongyu.com/