Init project
This commit is contained in:
parent
050fdb4f64
commit
e5d6c890a8
46 changed files with 7856 additions and 0 deletions
9
cms/src/routes/+error.svelte
Normal file
9
cms/src/routes/+error.svelte
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<script>
|
||||
import { page } from '$app/stores';
|
||||
</script>
|
||||
|
||||
<h1>{$page.error?.message}</h1>
|
||||
|
||||
<div>
|
||||
มีบางอย่างไม่ถูกต้องกรุณาติดต่อ 02-xxxxxxxx
|
||||
</div>
|
||||
11
cms/src/routes/+layout.svelte
Normal file
11
cms/src/routes/+layout.svelte
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<script>
|
||||
import '../app.postcss';
|
||||
import Header from '$lib/components/Header.svelte';
|
||||
</script>
|
||||
|
||||
<Header />
|
||||
<div class="p-10 max-w-4xl place-content-center ">
|
||||
<div>
|
||||
<slot />
|
||||
</div>
|
||||
</div>
|
||||
14
cms/src/routes/+page.svelte
Normal file
14
cms/src/routes/+page.svelte
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<h1 class="text-4xl">กองสรรหาบุคคล (Recruitment Division)</h1>
|
||||
|
||||
|
||||
|
||||
<h2 class="text-2xl">ประกาศเกี่ยวกับการคัดเลือกบุคลากรกทม</h2>
|
||||
<div>xxxx</div>
|
||||
<div>xxxx</div>
|
||||
<div>xxxx</div>
|
||||
<div>xxxx</div>
|
||||
<h2 class="text-2xl">ประกาศเกี่ยวกับการสอบแข่งขัน</h2>
|
||||
<div>xxxx</div>
|
||||
<div>xxxx</div>
|
||||
<div>xxxx</div>
|
||||
<div>xxxx</div>
|
||||
12
cms/src/routes/about/+page.server.ts
Normal file
12
cms/src/routes/about/+page.server.ts
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
|
||||
import {getContact} from "$lib/data/info"
|
||||
|
||||
import type { PageServerLoad } from './$types'
|
||||
/*
|
||||
export const load: PageServerLoad = async () => {
|
||||
return getContact()
|
||||
}*/
|
||||
|
||||
export const load = (async () => {
|
||||
return getContact()
|
||||
}) satisfies PageServerLoad
|
||||
10
cms/src/routes/about/+page.svelte
Normal file
10
cms/src/routes/about/+page.svelte
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<script lang="ts">
|
||||
import type { PageData } from './$types'
|
||||
export let data: PageData;
|
||||
</script>
|
||||
|
||||
<h1 class="text-4xl">{data.company_name}</h1>
|
||||
|
||||
<div>{data.description}</div>
|
||||
|
||||
|
||||
12
cms/src/routes/api/users/+server.ts
Normal file
12
cms/src/routes/api/users/+server.ts
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
import type { RequestEvent, RequestHandler } from './$types'
|
||||
import {json} from '@sveltejs/kit'
|
||||
import { createUser, getUsers } from '$lib/data/users'
|
||||
|
||||
//api/users
|
||||
export const POST: RequestHandler = async ({ request }: RequestEvent) => {
|
||||
const data = await request.json()
|
||||
return json(await createUser( data))
|
||||
}
|
||||
export const GET: RequestHandler = async () => {
|
||||
return json(await getUsers())
|
||||
}
|
||||
19
cms/src/routes/api/users/[id]/+server.ts
Normal file
19
cms/src/routes/api/users/[id]/+server.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import type { RequestEvent, RequestHandler } from './$types'
|
||||
import {json} from '@sveltejs/kit'
|
||||
import { getUser, updateUser } from '$lib/data/users'
|
||||
|
||||
//api/users/1
|
||||
export const PUT: RequestHandler = async ({ request }: RequestEvent) => {
|
||||
const o = await request.json()
|
||||
if(!updateUser(o))
|
||||
return json({message:"call updateUser fail "},{status:400})
|
||||
return json({message:"Update Success"})
|
||||
}
|
||||
export const GET: RequestHandler = async ({params}: RequestEvent) => {
|
||||
const id = Number(params.id)
|
||||
const u = await getUser(id)
|
||||
if(!u)
|
||||
return json({message:`User ${id} not found`},{status:404})
|
||||
return json(u)
|
||||
}
|
||||
|
||||
7
cms/src/routes/competitive/+page.svelte
Normal file
7
cms/src/routes/competitive/+page.svelte
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<h1 class="text-4xl">การสอบแข่งขัน</h1>
|
||||
|
||||
fdsafda
|
||||
fdsafda sdaf
|
||||
sdaffsdasaf rfffffffffffffffff fffffffffffffffffffffffff ffffffffffff fgedfgfdgfdsg
|
||||
fedsddddddddddddd ddddddddddddddd ddddddddd d d d d d d d d d d d d xxxx
|
||||
|
||||
6
cms/src/routes/qualifying/+page.svelte
Normal file
6
cms/src/routes/qualifying/+page.svelte
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<h1 class="text-4xl">การสอบคัดเลือก</h1>
|
||||
|
||||
<button class="btn btn-outline">Button</button>
|
||||
<button class="btn btn-outline btn-primary">Button</button>
|
||||
<button class="btn btn-outline btn-secondary">Button</button>
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue