Posts
Q&A
cardStackView ๊ตฌํ ์ค๋ฅ
๊ฒ์ํ๋๊น ๋์ค๋ค์ฉ ใ ใ ;; https://stackoverflow.com/questions/73028977/android-material-design-sample-code-giving-missing-resources-errors implementation 'androidx.appcompat:appcompat:1.5.1' implementation 'com.google.android.material:material:1.7.0'์์ ์๋ ๋ก ๋ฐ๊พธ๋ ๋ฉ๋๋ค.implementation 'androidx.appcompat:appcompat:1.4.1' implementation 'com.google.android.material:material:1.6.0'
- 0
- 1
- 2.2K
Q&A
error: readStudents Query error
๊ฐ์ฌ๋. indexController ์์ฑ์ฝ๋ ์ข ์ฌ๋ ค์ฃผ์ธ์... (ํ์ํ ์ด๋ธ ๊ด๋ จ๋๊ฑฐ์..) ์ ๊ฐ ๋ญ๊ฐ ์๋ชป ํ๊ณ ์๋ ๊ฒ ๊ฐ์์...const { pool } = require("../../config/database"); const { logger } = require("../../config/winston"); const jwt = require("jsonwebtoken"); const secret = require("../../config/secret"); const indexDao = require("../dao/indexDao"); //ํ์ ์ ๋ฐ์ดํธ exports.updateStudent = async function (req,res){ const { studentName, major, birth, address } = req.body; const { studentIdx } = req.params; if (studentName && typeof studentName !== "string") { return res.send({ isSuccess: false, code:400, //์์ฒญ์คํจ์ 400๋ฒ๋ ์ฝ๋ message: "๊ฐ์ ์ ํํ ์ ๋ ฅํด์ฃผ์ธ์.", }); } if (major && typeof major !== "string") { return res.send({ isSuccess: false, code:400, //์์ฒญ์คํจ์ 400๋ฒ๋ ์ฝ๋ message: "๊ฐ์ ์ ํํ ์ ๋ ฅํด์ฃผ์ธ์.", }); } if (address && typeof address !== "string") { return res.send({ isSuccess: false, code:400, //์์ฒญ์คํจ์ 400๋ฒ๋ ์ฝ๋ message: "๊ฐ์ ์ ํํ ์ ๋ ฅํด์ฃผ์ธ์.", }); } //birth : YYYY-MM-DD ํ์ ๊ฒ์ฌ var regex = RegExp(/^\d{4}\/(0[1-9]|1[012])\/(0[1-9]|[12][0-9]|3[01])$/); regex.test("2020/09/25"); if (birth && !regex.test(birth)) { return res.send({ isSuccess: false, code:400, //์์ฒญ์คํจ์ 400๋ฒ๋ ์ฝ๋ message: "๋ ์งํ์์ ํ์ธํด์ฃผ์ธ์.", }); } return; try { const connection = await pool.getConnection(async (conn) => conn); try { const isValidStudentIdx = await indexDao.isValidStudentIdx(studentIdx) if (!isValidStudentIdx) { return res.send({ result: rows, isSuccess: false, code: 410, // ์์ฒญ ์คํจ์ 400๋ฒ๋ ์ฝ๋ message: "์ ํจํ ํ์ ์ธ๋ฑ์ค๊ฐ ์๋๋๋ค.", }); } const [rows] = await indexDao.updateStudents(studentIdx, connection,studentName, major, birth, address); return res.send({ result: rows, isSuccess: true, code: 200, // ์์ฒญ ์คํจ์ 400๋ฒ๋ ์ฝ๋ message: "ํ์ ์์ ์ฑ๊ณต", }); } catch (err) { logger.error(`updateStudents Query error\n: ${JSON.stringify(err)}`); return false; } finally { connection.release(); } } catch (err) { logger.error(`updateStudents DB Connection error\n: ${JSON.stringify(err)}`); return false; } }; //ํ์ํ ์ด๋ธ ์กฐํ exports.selectStudents = async function(req, res){ const { studentIdx } = req.params; try { const connection = await pool.getConnection(async (conn) => conn); try { const [rows] = await indexDao.selectStudents(connection,studentIdx); return res.send({ result: rows, isSuccess: true, code: 200, // ์์ฒญ ์คํจ์ 400๋ฒ๋ ์ฝ๋ message: "์์ฒญ ์ฑ๊ณต", }); } catch (err) { logger.error(`selectStudents Query error\n: ${JSON.stringify(err)}`); return false; } finally { connection.release(); } } catch (err) { logger.error(`selectStudents DB Connection error\n: ${JSON.stringify(err)}`); return false; } } //ํ์ ์์ฑ exports.createStudent = async function(req,res) { const { studentName, major, birth, address } = req.body; console.log(studentName, major, birth, address); // studentName, major, address:๋ฌธ์์ด if ( typeof studentName !== "string" || typeof major !== "string" || typeof address !== "string" ) { return res.send({ isSuccess: false, code:400, //์์ฒญ์คํจ์ 400๋ฒ๋ ์ฝ๋ message: "๊ฐ์ ์ ํํ ์ ๋ ฅํด์ฃผ์ธ์.", }); } //birth : YYYY-MM-DD ํ์ ๊ฒ์ฌ var regex = RegExp(/^\d{4}\/(0[1-9]|1[012])\/(0[1-9]|[12][0-9]|3[01])$/); regex.test("2020/09/25"); if (!regex.test(birth)) { return res.send({ isSuccess: false, code:400, //์์ฒญ์คํจ์ 400๋ฒ๋ ์ฝ๋ message: "๋ ์งํ์์ ํ์ธํด์ฃผ์ธ์.", }); } try { const connection = await pool.getConnection(async (conn) => conn); try { const [rows] = await indexDao.insertStudents(connection,studentName, major, birth, address); return res.send({ result: rows, isSuccess: true, code: 200, // ์์ฒญ ์คํจ์ 400๋ฒ๋ ์ฝ๋ message: "ํ์ ์์ฑ ์ฑ๊ณต", }); } catch (err) { logger.error(`createStudent Query error\n: ${JSON.stringify(err)}`); return false; } finally { connection.release(); } } catch (err) { logger.error(`createStudent DB Connection error\n: ${JSON.stringify(err)}`); return false; } }; //ํ์ํ ์ด๋ธ ์กฐํ exports.readStudents = async function(req, res){ const { studentIdx } = req.params; try { const connection = await pool.getConnection(async (conn) => conn); try { const [rows] = await indexDao.readStudents(connection,studentIdx); return res.send({ result: rows, isSuccess: true, code: 200, // ์์ฒญ ์คํจ์ 400๋ฒ๋ ์ฝ๋ message: "์์ฒญ ์ฑ๊ณต", }); } catch (err) { logger.error(`readStudents Query error\n: ${JSON.stringify(err)}`); return false; } finally { connection.release(); } } catch (err) { logger.error(`readStudents DB Connection error\n: ${JSON.stringify(err)}`); return false; } };
- 0
- 2
- 288
Q&A
์ด๋ฏธ์ง ์ ๋ฐ ๋ ํด๊ฒฐ๋ฒ!
์๋ ํ์ธ์. ์ด๋ ๊ฒ ์คํํ๋๋ฐ๋ ์๋น๋๋ค ใ ใ ์์ด๋ด๊น์? uses-permission android:name="android.permission.INTERNET" /> ์ถ๊ฐํ์ต๋๋ค.(์ฌ์ง)
- 2
- 4
- 900
Q&A
์ํฌํธ ๋ฒํผ์ด ์๋น๋๋ค.
gradle ๋ถ๋ถ์ ๋๋ค(์ฌ์ง)(์ฌ์ง)(์ฌ์ง) project modeles ์ ๋นจ๊ฐ์์ด ๋ ์์ ๋ ์ฝํธ๋ฆฐ 1.3์ด ์๋๋ฐ ์ด๋์ ๋ค์ด๋ฐ์์ผํ๋ฝ(์ฌ์ง)
- 1
- 1
- 234