This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var bearsApi = Vue.resource('/blog/bears/'); | |
Vue.component('input-form', { | |
props: ['bears','bearAttr'], | |
data: function() { | |
return { | |
title: '', | |
body: '', | |
id:'' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var bearsApi = Vue.resource('/blog/bears/'); | |
Vue.component('input-form', { | |
props: ['bears'], | |
data: function() { | |
return { | |
title: '', | |
id:'' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// GET all | |
fetch('/message/').then(response => response.json().then(console.log)) | |
// GET one | |
fetch('/message/2').then(response => response.json().then(console.log)) | |
// POST add new one | |
fetch( | |
'/message', | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// GET all | |
fetch('/message/').then(response => response.json().then(console.log)) | |
// GET one | |
fetch('/message/2').then(response => response.json().then(console.log)) | |
// POST add new one | |
fetch( | |
'/message', | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Бот сохраняет вопросы задаваемые пользователями канала в БД, и при обращении к нему выдает список вопросов, при ответе на них у задающего | |
вопрос будет возможность установить сатус вопрос решен, он будет сохранен в БД, и затем можно будет обратиться к этому вопросу | |
и посмотреть его решение, также это добавляет к карме отвечающего, и возможно дает ему какие-нибудь ачивки. | |
Бот сохраняет каждого пользователя в свою базу, при написании своего первого сообщения пользователя в чат. | |
В телеграмме пользователи могут менять имя, фамилию, юзернейм, т.е. может получиться что пользователь для бота будет новым чуваком, | |
поэтому во всех операциях сравнения, поиска и обращений к бд где указывается пользователь, за ключ берется telegram.user.id. | |
он уникальный. Также если юзер меняет свой ник, имя, фамилию то бот в фоне обновит эти данные в таблице. | |
все вопросы записываются в БД только если перед вопросом стоит условный #ТЭГ вопроса, вопрос записывается в базу со статусом не решенный и |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface QuestRepo extends JpaRepository<Quest, Long> { | |
List<Quest> findAllByAuthorId(String authorId); | |
List<Quest> findAllByDoneIsFalseOrderByLocalDateTime(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>org.a2lpo.example</groupId> | |
<artifactId>gram_bot</artifactId> | |
<version>1.0-SNAPSHOT</version> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.alpo.example.jitt3r.entity; | |
import javax.persistence.*; | |
@Entity | |
public class Comment { | |
@Id | |
@GeneratedValue(strategy = GenerationType.AUTO) | |
private long id; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<#import "parts/common.ftl" as c> | |
<@c.page> | |
<h2 style="color: red">${project.prj_name}</h2> | |
<form method="post" action="/desk/add"> | |
<input type="text" name="deskName" class="form-control"> | |
<input type="hidden" name="_csrf" value="${_csrf.token}"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create sequence hibernate_sequence start 1 increment 1; | |
create table message ( | |
id int8 not null, | |
filename varchar(255), | |
tag varchar(255) not null, | |
text varchar(2048) not null, | |
user_id int8, | |
primary key (id) | |
); |
NewerOlder