Initial commit
This commit is contained in:
13
shared/modules/time-tracking/api.ts
Normal file
13
shared/modules/time-tracking/api.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { defineEndpoints } from '../types.js'
|
||||
|
||||
export const TIME_TRACKING_ENDPOINTS = defineEndpoints({
|
||||
current: { path: '/current', method: 'GET' },
|
||||
event: { path: '/event', method: 'POST' },
|
||||
day: { path: '/day/:date', method: 'GET' },
|
||||
week: { path: '/week/:startDate', method: 'GET' },
|
||||
month: { path: '/month/:yearMonth', method: 'GET' },
|
||||
year: { path: '/year/:year', method: 'GET' },
|
||||
stats: { path: '/stats', method: 'GET' },
|
||||
})
|
||||
|
||||
export type TimeTrackingEndpoints = typeof TIME_TRACKING_ENDPOINTS
|
||||
15
shared/modules/time-tracking/index.ts
Normal file
15
shared/modules/time-tracking/index.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { defineApiModule } from '../types.js'
|
||||
import { TIME_TRACKING_ENDPOINTS } from './api.js'
|
||||
|
||||
export * from './api.js'
|
||||
|
||||
export const TIME_TRACKING_MODULE = defineApiModule({
|
||||
id: 'time-tracking',
|
||||
name: '时间统计',
|
||||
basePath: '/time',
|
||||
order: 20,
|
||||
version: '1.0.0',
|
||||
endpoints: TIME_TRACKING_ENDPOINTS,
|
||||
})
|
||||
|
||||
export type { TimeTrackingEndpoints } from './api.js'
|
||||
Reference in New Issue
Block a user