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
from datetime import timedelta, datetime | |
import jwt | |
secret_key = "09d25e094faa6ca2556c818166b7a9563b93f7099f6f0f4caa6cf63b88e8d3e7" | |
algorithm = "HS256" | |
def create_access_token(*, data: dict, expires_delta: timedelta = None): | |
to_encode = data.copy() | |
if expires_delta: |
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 uvicorn | |
from fastapi.security import OAuth2PasswordBearer | |
from jwt import PyJWTError | |
from sqlalchemy.orm import Session | |
from fastapi import Depends, FastAPI, HTTPException | |
from starlette import status | |
from sql_app import models, schemas, crud | |
from sql_app.app_utils import decode_access_token | |
from sql_app.crud import get_user_by_username |
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"?> | |
<!DOCTYPE hibernate-configuration PUBLIC | |
"-//Hibernate/Hibernate Configuration DTD 3.0//EN" | |
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> | |
<hibernate-configuration> | |
<session-factory> | |
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property> | |
<property name="hibernate.connection.url"> | |
jdbc:mysql://localhost:3306/restapi | |
</property> |
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 common.db.blog; | |
import common.db.Base; | |
import common.db.HibernateEdition; | |
public abstract class Blog { | |
private Base base = new Base(); |
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 common.db.blog; | |
import common.db.Base; | |
import java.util.List; | |
import java.util.Map; | |
public class BlogSimple extends Blog { | |
private Base base = new Base(); |
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
<dependency> | |
<groupId>org.springdoc</groupId> | |
<artifactId>springdoc-openapi-ui</artifactId> | |
<version>1.2.32</version> | |
</dependency> |
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 vas.dealer.report.controller; | |
import io.swagger.v3.oas.annotations.Operation; | |
import io.swagger.v3.oas.annotations.media.ArraySchema; | |
import io.swagger.v3.oas.annotations.media.Content; | |
import io.swagger.v3.oas.annotations.media.Schema; | |
import io.swagger.v3.oas.annotations.responses.ApiResponse; | |
import io.swagger.v3.oas.annotations.responses.ApiResponses; | |
import io.swagger.v3.oas.annotations.tags.Tag; | |
import lombok.extern.slf4j.Slf4j; |
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 donald.apiwithspringboot.controller; | |
import donald.apiwithspringboot.model.Blog; | |
import donald.apiwithspringboot.repository.BlogRepository; | |
import io.swagger.v3.oas.annotations.Operation; | |
import io.swagger.v3.oas.annotations.media.ArraySchema; | |
import io.swagger.v3.oas.annotations.media.Content; | |
import io.swagger.v3.oas.annotations.media.Schema; | |
import io.swagger.v3.oas.annotations.responses.ApiResponse; |
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
class TestBrowser: | |
def test_debug_1(self): | |
from testscripts.smoketest.common import uninstall_then_install_coccoc_with_default | |
uninstall_then_install_coccoc_with_default(is_needed_clear_user_data=True,is_needed_clean_up=True) | |
def test_debug_2(self, browser): | |
from utils_automation.const import Urls | |
browser.get(Urls.COCCOC_FLAGS) | |
search_bar = browser.find_element_by_id('search') |
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
type Mutation{ | |
createUserInfo(input: CreateUserInfo!) : Boolean! | |
authenticateUserInfo(input: AuthenticateUserInfo!): JwtResponse! | |
createBlog(input: CreateBlog!) : Blog! | |
} | |
input CreateUserInfo{ | |
username: String! | |
password: String! | |
fullname: String! | |
} |